Class parserFunction

Description
  • author: Greg Beaver <[email protected]>
  • version: $Id: ParserElements.inc 289555 2009-10-12 03:52:03Z ashnazg $
  • copyright: 2002-2008 Gregory Beaver
  • since: 1.0rc1

Located in /phpDocumentor/ParserElements.inc (line 321)

parserBase
   |
   --parserElement
      |
      --parserFunction
Direct descendents
Class Description
parserMethod
Variable Summary
array $globals
array $params
mixed $source
array $statics
string $type
Method Summary
void addGlobals (array $globals)
void addParam (string $name, string $value, [boolean $has_default = true], [null|string $typehint = null])
void addSource (string|array $source)
void addStatics (array $static, array $vals)
mixed getConflicts (Converter &$c)
string getFunctionCall ()
array getIntricateFunctionCall ( $converter,  $paramtags)
mixed getLink (Converter $c, [string $text = false], [ $returnobj = false])
string getParam (string $name)
boolean getReturnsReference ()
string|array getSource ()
boolean hasSource ()
array listGlobals ()
array listParams ()
array listStatics ()
Variables
array $globals = false (line 351)

global declarations parsed from function definition

  • var: Format: array(globalname1, globalname2,....)
array $params = false (line 335)

parameters parsed from function definition.

param name may be null, in which case, updateParams() must be called from the Converter

  • var: Format: array(param name => default value parsed from function definition)
  • see: updateParams()
boolean $returnsreference = false (line 345)

Function returns a reference to an element, instead of a value

set to true if function is declared as:

  1.  function &func(...

mixed $source = '' (line 358)
array $statics = false (line 356)

static variable declarations parsed from function definition

  • var: Format: array(array('name' => staticvar1,'val' => '' or default val of staticvar1),...)
string $type = 'function' (line 327)

Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah'

  • var: always 'function'

Redefinition of:
parserBase::$type
Type is used by many functions to skip the hassle of if

Redefined in descendants as:
  • parserMethod::$type : Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah'

Inherited Variables

Inherited from parserElement

parserElement::$conflicts
parserElement::$docblock
parserElement::$endlinenumber
parserElement::$file
parserElement::$linenumber
parserElement::$name
parserElement::$path

Inherited from parserBase

parserBase::$value
Methods
addGlobals (line 433)

Add all "global $var, $var2" declarations to this function

void addGlobals (array $globals)
  • array $globals: Format: array(globalname1, globalname2,....)
addParam (line 366)
void addParam (string $name, string $value, [boolean $has_default = true], [null|string $typehint = null])
  • string $name
  • string $value: default value parsed from function definition
  • boolean $has_default: indicates whether this parameter has a default value
  • null|string $typehint: class type hint

Redefined in descendants as:
addSource (line 379)

Set the source code. Always array in PHP 4.3.0+

void addSource (string|array $source)
  • string|array $source
addStatics (line 443)

Add all "static $var, $var2 = 6" declarations to this function

void addStatics (array $static, array $vals)
  • array $static: Format: array(varname1, varname2,...)
  • array $vals: Format: array(default val of var 1, default val of var 2,...) if var 1 has no default, array(default val of var 2,...)
getConflicts (line 422)

Returns all functions in other packages that have the same name as this function

mixed getConflicts (Converter &$c)
getFunctionCall (line 580)

Get a human-friendly description of the function call

takes declaration like:

  1.  /** @returns string ... {rest of docblock}
  2.  function &func($param1, $param2 = 6,
  3.                 $param3 = array('20',9 => "heroo"))
  4.  {...}
and returns: string &func( $param1, [$param2 = 6], [$param3 = array('20',9 => "heroo")] )

  • return: stylized function declaration
string getFunctionCall ()

Redefined in descendants as:
getIntricateFunctionCall (line 621)

Like getFunctionCall(), but has no English or pre-determined formatting.

Much more flexible.

  • return: Format:
    1.  array('name' => function name,
    2.        'returnsref' => boolean if declared as "function &name()"
    3.        'params' => array('type' => data type of parameter,
    4.                          'description' => from @param tag,
    5.                          'name' => variable name,
    6.                          'default' => default value if any))
  • see: parserFunction::getFunctionCall()
array getIntricateFunctionCall ( $converter,  $paramtags)
  • $converter
  • $paramtags

Redefined in descendants as:
getLink (line 408)

quick way to link to this element

  • return: converter-specific link to this function
mixed getLink (Converter $c, [string $text = false], [ $returnobj = false])
  • Converter $c
  • string $text: text to display for the link or false for default text
  • $returnobj

Redefined in descendants as:
getParam (line 464)
  • return: default value of param $name
string getParam (string $name)
  • string $name
getReturnsReference (line 561)
boolean getReturnsReference ()
getSource (line 397)
  • return: source code ready for highlighting
string|array getSource ()
hasSource (line 388)

Determine whether the source code has been requested via {@source}

boolean hasSource ()
listGlobals (line 515)
  • return: format: array(array(index, globalname),...)
array listGlobals ()
listParams (line 480)
  • return: format: array(array(paramname, default value),...)
array listParams ()
listStatics (line 534)
  • return: format: array(array(static var name, static var default value),...)
array listStatics ()
setReturnsReference (line 553)

sets $returnsreference to true

void setReturnsReference ()

Inherited Methods

Inherited From parserElement

parserElement::getEndLineNumber()
parserElement::getFile()
parserElement::getLineNumber()
parserElement::getName()
parserElement::getPackage()
parserElement::getPath()
parserElement::setDocBlock()
parserElement::setEndLineNumber()
parserElement::setFile()
parserElement::setLineNumber()
parserElement::setName()
parserElement::setPath()

Inherited From parserBase

parserBase::getType()
parserBase::getValue()
parserBase::setValue()

Documentation generated on Mon, 05 Dec 2011 21:00:42 -0600 by phpDocumentor 1.4.4