Class parserDocBlock

Description

Represents a docblock and its components, $desc, $sdesc, $tags, and also $params for functions

  • author: Greg Beaver <cellog@php.net>
  • version: $Id: ParserDocBlock.inc 287886 2009-08-30 05:31:05Z ashnazg $
  • since: 1.0rc1

Located in /phpDocumentor/ParserDocBlock.inc (line 129)


	
			
Variable Summary
string $category
false|integer $endlinenumber
array $funcglobals
boolean $hasaccess
boolean $hasname
false|integer $linenumber
string $package
array $params
mixed $properties
mixed $return
array $statics
string $subpackage
array $tags
mixed $var
Method Summary
parserDocBlock parserDocBlock ()
void addAccess (string $value)
void addExample (string $value, string $path)
void addFileSource (string $path, array $source)
void addFuncGlobal (string $type, string $value)
void addKeyword (string $keyword, parserStringWithInlineTags $value)
void addLink (string $link)
void addName (string $value)
void addPackage (string $keyword, mixed $value)
void addParam (string $paramVar,  $paramType, parserStringWithInlineTags $value)
void addProperty ( $tagName,  $propertyName,  $propertyType,  $value)
void addReturn (string $returnType, parserStringWithInlineTags $value)
void addSee (string $keyword, string $value)
void addStaticVar (string $staticvar, string $type, parserStringWithInlineTags $descrip)
void addTag (parserTag $tag)
void addUnknownTag (string $keyword, string $value)
void addUses (string $seeel, parserStringWithInlineTags $description)
void addVar (string $varType, parserStringWithInlineTags $value)
void canSource ()
void cantSource ()
void changeGlobal (integer $index, string $name)
void changeParam (integer $index, string $name, string|null $type)
void changeStatic (integer $index, string $name)
string getDesc (Converter &$converter)
integer getEndLineNumber ()
boolean getExplicitCategory ()
boolean getExplicitPackage ()
mixed getKeyword (string $keyword)
integer getLineNumber ()
string getSDesc (Converter &$converter)
string getType ()
boolean hasInheritDoc ()
array listParams ()
array listProperties ()
void listTags (Converter 0)
void overridePackage (string $category, string $package, string $subpackage, string $elname, string $type)
void postProcess ()
void resetParams ()
void setEndLineNumber (integer $number)
void setLineNumber (integer $number)
void setSource (string|array $source, [false|string $class = false])
void updateGlobals (array $funcs)
void updateModifiers (array $modifiers)
void updateParams (array $params)
void updateStatics (array $funcs)
Variables
string $category (line 219)
parserDesc $desc = false (line 134)
false|integer $endlinenumber = false (line 158)

Line number in the source on which this docblock ends

  • since: 1.2
boolean $explicitcategory = false (line 217)

fix for bug 708559

boolean $explicitpackage = false (line 212)

fix for bug 591396

array $funcglobals = array() (line 184)

array of global variable data.

Format: array(index of global variable in @global tag list -OR- global variable name => array(datatype,parserStringWithInlineTags),...)

boolean $hasaccess = false (line 227)

whether this DocBlock has an @access tag

boolean $hasname = false (line 231)

whether this DocBlock has a @name tag

false|integer $linenumber = false (line 152)

Line number in the source on which this docblock begins

  • since: 1.2
string $package = 'default' (line 221)
string $packagedescrip = '' (line 237)

description of package parsed from @package tag

Unused in this version

array $params = array() (line 176)

array of param data.

Format: array(index of param in function parameter list -OR- parameter name => parserStringWithInlineTags,...)

array $processed_desc = false (line 138)
array $processed_sdesc = false (line 142)
mixed $properties = array() (line 197)

array of parserPropertyTag, parserPropertyReadTag, parserPropertyWriteTag, parserMethodTag magic tags

mixed $return = false (line 202)

This is either a parserReturnTag or false if no return tag is present

parserDesc $sdesc = false (line 146)
array $statics = array() (line 193)

array of static variable data.

Format: array(index of static variable in @global tag list -OR- static variable name => parserStaticvarTag,...)

string $subpackage = '' (line 223)
string $subpackagedescrip = '' (line 243)

description of subpackage parsed from @package tag

Unused in this version

array $tags = array() (line 163)

array of parserTags

array $unknown_tags = array() (line 168)

array of unrecognized parserTags

mixed $var = false (line 207)

This is either a parserVarTag or false if no var tag is present

Methods
Constructor parserDocBlock (line 256)

sets package to default

parserDocBlock parserDocBlock ()
addAccess (line 916)

add an @access tag to the tags array

void addAccess (string $value)
  • string $value: should be either public or private
addExample (line 641)

adds an @example tag

void addExample (string $value, string $path)
  • string $value: contents of the tag
  • string $path: path to the file containing this tag
addFileSource (line 943)

Adds a new @filesource tag to the DocBlock

void addFileSource (string $path, array $source)
  • string $path: full path to the file
  • array $source: tokenized source code, ordered by line number
addFuncGlobal (line 857)

adds a function declaration of @global to the $funcglobals array

void addFuncGlobal (string $type, string $value)
  • string $type: global type
  • string $value: description of how the global is used in the function
addKeyword (line 609)
void addKeyword (string $keyword, parserStringWithInlineTags $value)
addLink (line 953)

creates a parserLinkTag and adds it to the $tags array

void addLink (string $link)
  • string $link
addName (line 825)

Adds a @name tag to the tag list

void addName (string $value)
  • string $value: new name of element
addPackage (line 728)
void addPackage (string $keyword, mixed $value)
  • string $keyword: tag name (either package or subpackage)
  • mixed $value: either a string or a parserStringWithInlineTags. Strips all inline tags and use the text as the package
addParam (line 520)
void addParam (string $paramVar,  $paramType, parserStringWithInlineTags $value)
addProperty (line 1033)

Adds a @property(-read or -write) or @method magic tag to the DocBlock

void addProperty ( $tagName,  $propertyName,  $propertyType,  $value)
  • $tagName
  • $propertyName
  • $propertyType
  • $value
addReturn (line 976)

creates a parserReturnTag and adds it to the $tags array

void addReturn (string $returnType, parserStringWithInlineTags $value)
  • string $returnType: the one-word name of the return type (mixed should be used if more than one type)
  • parserStringWithInlineTags $value
addSee (line 964)

creates a parserLinkTag and adds it to the $tags array

void addSee (string $keyword, string $value)
  • string $value
  • string $keyword: either see or uses
addStaticVar (line 844)
void addStaticVar (string $staticvar, string $type, parserStringWithInlineTags $descrip)
addTag (line 587)

Used to insert DocBlock Template tags into a docblock

void addTag (parserTag $tag)
addUnknownTag (line 651)

adds an unknown tag to the $unknown_tags array for use by custom converters

void addUnknownTag (string $keyword, string $value)
  • string $keyword: tag name
  • string $value: tag value
addUses (line 1024)

Add a @uses tag to the DocBlock

void addUses (string $seeel, parserStringWithInlineTags $description)
addVar (line 993)

creates a parserVarTag and adds it to the $tags array

void addVar (string $varType, parserStringWithInlineTags $value)
  • string $varType: the one-word name of the variable type (mixed should be used if more than one type)
  • parserStringWithInlineTags $value
canSource (line 320)

Tells the DocBlock it can have a @filesource tag

Only page-level DocBlocks may have a @filesource tag

void canSource ()
cantSource (line 330)

Tells the DocBlock it can't have a @filesource tag

Only page-level DocBlocks may have a @filesource tag

void cantSource ()
changeGlobal (line 866)
void changeGlobal (integer $index, string $name)
  • integer $index: index of parameter in the $funcglobals array
  • string $name: name of the parameter to set in the $funcglobals array
changeParam (line 537)
void changeParam (integer $index, string $name, string|null $type)
  • integer $index: index of parameter in the $params array
  • string $name: name of the parameter to set in the $params array
  • string|null $type: type of the parameter
changeStatic (line 876)
void changeStatic (integer $index, string $name)
  • integer $index: index of parameter in the $statics array
  • string $name: name of the parameter to set in the $statics array
getDesc (line 498)
string getDesc (Converter &$converter)
  • Converter &$converter: takes $desc and converts it to a string and returns it if present, otherwise returns ''
getEndLineNumber (line 294)

Retrieve ending line number

integer getEndLineNumber ()
getExplicitCategory (line 719)

If the DocBlock has a @category tag, then this returns true

boolean getExplicitCategory ()
getExplicitPackage (line 698)

If the DocBlock has a @package tag, then this returns true

boolean getExplicitPackage ()
getKeyword (line 1076)
  • return: false if no keyword, unconverted value if one keyword, array of unconverted values if more than one keyword
mixed getKeyword (string $keyword)
  • string $keyword
getLineNumber (line 276)

Retrieve starting line number

integer getLineNumber ()
getSDesc (line 476)
string getSDesc (Converter &$converter)
  • Converter &$converter: takes $sdesc and converts it to a string and returns it if present, otherwise returns ''
getType (line 1141)
  • return: always 'docblock'
string getType ()
hasInheritDoc (line 453)

Wrapper for parserDesc::hasInheritDoc()

boolean hasInheritDoc ()
listParams (line 1091)
  • return: Format: array('var' => tag name, 'data' => unconverted tag value)
array listParams ()
listProperties (line 1109)
  • return: Format: array('var' => tag name, 'data' => unconverted tag value)
array listProperties ()
listTags (line 1125)
void listTags (Converter 0)
overridePackage (line 666)

set the element's package to the passed values. Used in phpDocumentor_IntermediateParser to align package of

elements inside a class or procedural page to the package of the class/procedural page

void overridePackage (string $category, string $package, string $subpackage, string $elname, string $type)
  • string $category
  • string $package
  • string $subpackage
  • string $elname: element name
  • string $type: element type (include, define, var, method, global, function, const)
postProcess (line 304)

Parse out any html tags from doc comments, and make them into

abstract structures

void postProcess ()
replaceInheritDoc (line 465)

Wrapper for parserDesc::replaceInheritDoc()

Also replaces {@inheritdoc} in the $processed_desc

void replaceInheritDoc (parserDesc $desc)
resetParams (line 528)
void resetParams ()
setDesc (line 438)
void setDesc (parserDesc|parserDocBlock $desc)
setEndLineNumber (line 285)

Sets the ending line number for the DocBlock

void setEndLineNumber (integer $number)
  • integer $number
setExplicitCategory (line 710)

Used if this docblock has a @category tag.

phpDocumentor will guess category for DocBlocks that don't have a @category tag

void setExplicitCategory ()
setExplicitPackage (line 689)

Used if this docblock has a @package tag.

phpDocumentor will guess package for DocBlocks that don't have a @package tag

void setExplicitPackage ()
setLineNumber (line 267)

Sets the starting line number for the DocBlock

void setLineNumber (integer $number)
  • integer $number
setShortDesc (line 396)

Set the short description of the DocBlock

Setting the short description is possible by passing in one of three possible parameters:

  • another DocBlock's short description
  • another DocBlock, the short description will be extracted
  • a Zend Studio-compatible @desc tag

void setShortDesc (parserDesc|parserDocBlock|parserTag $desc)
setSource (line 426)

Passes to parserStringWithInlineTags::setSource()

After passing, it calls postProcess() to set up the new source

void setSource (string|array $source, [false|string $class = false])
  • string|array $source: tokenized highlight-ready source code
  • false|string $class: name of class if this is a method source
updateGlobals (line 886)

replaces nameless global variables in the $funcglobals array with their names

void updateGlobals (array $funcs)
  • array $funcs
updateModifiers (line 355)
void updateModifiers (array $modifiers)
  • array $modifiers
updateParams (line 552)

replaces nameless parameters in the $params array with their names

add @param tags for params in the function with no entry

void updateParams (array $params)
  • array $params: Format: array(parameter key => array(0 => parameter name[,1 => default value][,2 => type hint]),...)
updateStatics (line 901)

replaces nameless static variables in the $statics array with their names

void updateStatics (array $funcs)
  • array $funcs

Documentation generated on Mon, 05 Dec 2011 21:51:02 -0600 by phpDocumentor 1.4.4