BespokeDocBlockParser
class BespokeDocBlockParser (View source)
Given a class and method name, parse the annotations in the DocBlock comment, and provide accessor methods for all of the elements that are needed to create an annotated Command.
Properties
protected | $fqcnCache | ||
protected | $commandInfo | ||
protected | $reflection | ||
protected | $optionParamName | ||
protected array | $tagProcessors |
Methods
No description
Parse the docBlock comment for this command, and set the fields of this class with the data thereby obtained.
Save any tag that we do not explicitly recognize in the 'otherAnnotations' map.
Set the name of the command from a @command or @name annotation.
The @description and @desc annotations may be used in place of the synopsis (which we call 'description').
Store the data from a @param annotation in our argument descriptions.
No description
Store the data from a @arg annotation in our argument descriptions.
Store the data from an @option annotation in our option descriptions.
No description
Store the data from a @default annotation in our argument or option store, as appropriate.
Store the data from a @usage annotation in our example usage list.
Process the comma-separated list of aliases
Store the data from a @return annotation in our argument descriptions.
No description
No description
No description
No description
No description
Return the name of the last parameter if it holds the options.
No description
Given a list that might be 'a b c' or 'a, b, c' or 'a,b,c', convert the data into the last of these forms.
Take a multiline description and convert it into a single long unbroken line.
Details
__construct(CommandInfo $commandInfo, ReflectionMethod $reflection, $fqcnCache = null)
No description
parse()
Parse the docBlock comment for this command, and set the fields of this class with the data thereby obtained.
protected
processGenericTag($tag)
Save any tag that we do not explicitly recognize in the 'otherAnnotations' map.
protected
processCommandTag($tag)
Set the name of the command from a @command or @name annotation.
protected
processAlternateDescriptionTag($tag)
deprecated
deprecated
The @description and @desc annotations may be used in place of the synopsis (which we call 'description').
This is discouraged.
protected
processParamTag($tag)
Store the data from a @param annotation in our argument descriptions.
protected
ignoredParamType($paramType)
No description
protected
processArgumentTag($tag)
Store the data from a @arg annotation in our argument descriptions.
protected
processOptionTag($tag)
Store the data from an @option annotation in our option descriptions.
protected
addOptionOrArgumentTag($tag, DefaultsWithDescriptions $set, $name, $description)
No description
protected
splitOutDefault($description)
No description
protected
processDefaultTag($tag)
Store the data from a @default annotation in our argument or option store, as appropriate.
protected
processUsageTag($tag)
Store the data from a @usage annotation in our example usage list.
protected
processAliases($tag)
Process the comma-separated list of aliases
protected
processReturnTag($tag)
Store the data from a @return annotation in our argument descriptions.
protected
findFullyQualifiedClass($className)
No description
protected
processDescriptionAndHelp($lines)
No description
protected
nextLineIsNotEmpty($lines)
No description
protected
processAllTags($tags)
No description
protected
lastParameterName()
No description
optionParamName()
Return the name of the last parameter if it holds the options.
protected
interpretDefaultValue($defaultValue)
No description
static protected
convertListToCommaSeparated($text)
Given a list that might be 'a b c' or 'a, b, c' or 'a,b,c', convert the data into the last of these forms.
static protected
removeLineBreaks($text)
Take a multiline description and convert it into a single long unbroken line.