Last active
August 28, 2015 10:04
-
-
Save heiglandreas/9a4133e3d3f8bada3a27 to your computer and use it in GitHub Desktop.
How to describe needed information for a method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class TestAction implements GenericAction | |
/** | |
* How would I describe that this method required the 'test'-parameter to be set? | |
* | |
* It shouldn't be @param as it's not a parameter to the method. An inline/embedded PHPDoc-comment | |
* wouldn't work as there's nothing I could add it to. | |
* | |
* I would have expected something like @requires or @expects to define that like so: | |
* | |
* @expects string $this->getRequest()->getParam('test) The give REQUEST-parameter 'test' | |
* | |
* @return mixed | |
*/ | |
public function testAction() | |
{ | |
$test = $this->getRequest()->getParam('test'); | |
return $test; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment