How to tag preconditions with PHPDoc? I have an object, and before calling a function another function must have been called:
$myObject = new MyClass();
$myObject->mustDoThis();
$myObject->beforeThis();
So the documentation for beforeThis()
would look like:
/**
* @precondition mustDoThis() must be called before this function is
*/
Or is there another way around this? Perhaps a @throw
clause would be enough.