I noticed that Microsoft named its code contract features in .NET 4 in a weird way.
They add "s" at the end of "require" and "provide", therefore Contract.Requires () and Contract.Ensures () exist, but not at the end of "assert" and "take", therefore there is Contract.Assert () and Contract .Assume (). This difference bothers me a little.
Actually, my real problem is that I am trying to use the contract code in PHP, so I am writing something to imitate the Contract class in .NET 4. Since PHP does not have a built-in method for checking the type of parameters, I am adding a method to my own class Contract to do some validation. I choose the word "wait" because I think that "expect the parameter" bar "to be a string, but ..." is a common message when the type of the parameter is incorrect. And there is a problem. Should I name my Contract.Expect () method or should I name it Contract.Expects ()?
I am from a country that does not speak English, so sorry for my poor English. Maybe this is actually a question in English, but I think that only programmers can help me. Sorry if this question does not fit here.
ani
source share