-
Notifications
You must be signed in to change notification settings - Fork 34
classes_reflection_phpdoccomment.class
Represents a PHP DocComment as described in http://en.wikipedia.org/wiki/PHPDoc Use PhpDocComment::Parse to create an instance.
Ensures that there's a short description set.
Definition: public function EnsureDescription($default_description)
Returns: void
Parameters:
-
string $default_descriptionText to set if there's no ShortDesc yet
Ensures that there's a description set for the given tag. Note that this will set the $default_description for all tags that match $tag, so do not use with 'param' and others that may appear multiple times.
Definition: public function EnsureTagDescription($tag, $default_description)
Returns: void
Parameters:
-
string $tagTag name like 'internal', 'override' -
string $default_descriptionText to set if there's none yet
Returns a specific annotation
If scheme is @mySomething This is my comment you can call it like get('mySomething');
Definition: public function get($name)
Returns: mixed The description (may be empty) or false
Parameters:
-
string $nameName of the annotation
Gets the deprecated note if present Every DocComment may contain a @deprecated part. This method returns it
Definition: public function getDeprecated()
Returns: mixed The deprecated note if present or false
Returns docs for a specified parameter Every method parameter should have an @param block in the DocComment. This method returns it
Definition: public function getParam($name)
Returns: mixed The parameter description or false on error
Parameters:
-
string $nameParameter name
Lists all param docs Every method parameter should have an @param block in the DocComment. This returns all of them
Definition: public function getParams()
Returns: array All param block
Gets the return documentation Every method should have a @return block in the DocComment. This method returns it
Definition: public function getReturn()
Returns: mixed The return doc or false on error
Returns tags with a given name. Sample:
$docComment->getTags('param',array('type','var','desc')); Definition: public function getTags($name, $scheme)
Returns: array Array of associative arrays with tag data
Parameters:
-
string $nameTag name -
array $schemeArray of properties the pure description shall be split into
Returns an array of all tags values. Sample:
//
Definition: `public function getTagValues($name)`
Returns: `array` Array of tag values
Parameters:
* `mixed $name` Tag name
### <a id='3309a7a7941818e131b4dfb9a6349914'/>has
Checks if there's a specific annotation present.
Definition: `public function has($name)`
Returns: `bool` true or false
Parameters:
* `string $name` Name of annotation to check
### <a id='4e61bd2ab241cce01775d4d6068876fd'/>hasOne
Check if theres at least one of the given annotations present
Will use all given arguments as input
```php
$dc->hasOne('internal','deprecated','override'); Definition: public function hasOne($args)
Returns: bool true or false
Parameters:
-
mixed $argsAnnotation names
Creates a PhpDocComment instance from a string See WdfReflector::getCommentObject for how to use this best.
Definition: public static function Parse($comment)
Returns: bool|PhpDocComment False on error, else a PhpDocComment object
Parameters:
-
string $commentValid DocComment string
Returns the description ready for use in markdown syntax Markdown is our favorite for automated documentation creation as GitHub supports it directly for their Wiki. This method makes some preparations for the doccomment to be complatible with MD.
Definition: public function RenderAsMD()
Returns: string MD prepared string