Skip to content

Instantly share code, notes, and snippets.

@heiglandreas
Last active August 28, 2015 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heiglandreas/9a4133e3d3f8bada3a27 to your computer and use it in GitHub Desktop.
Save heiglandreas/9a4133e3d3f8bada3a27 to your computer and use it in GitHub Desktop.
How to describe needed information for a method
<?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