Responsible for adding inheritance behaviour to an individual class.

category phpDocumentor
package Transformer
subpackage Behaviour
author Mike van Riel
license MIT
link http://phpdoc.org

 Methods

Passes all unknown method directly into the node.

__call(string $name, \mixed[] $arguments) : mixed
Inherited

inherited_from \phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Abstract::__call()

Parameters

$name

string

Method name.

$arguments

\mixed[]

Array containing the method arguments.

Returns

mixed

Load the node belonging to this object and make an associative array of classes and interfaces available.

__construct(DOMElement $node, array $nodes) 
Inherited

inherited_from \phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Abstract::__construct()

Parameters

$node

\DOMElement

Node that needs to be decorated by this class.

$nodes

\phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Class[]

&$nodes Associative array containing all class/interface type nodes.

Returns the docblock element for the given node; if none exists it will be added.

getDocBlock() : \phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_DocBlock
Inherited

inherited_from \phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Abstract::getDocBlock()

Returns

Returns the Fully Qualified Class Name for this class or interface.

getFQCN() : string

Returns

string

Returns the names of the interfaces that are implemented by this class.

getInterfacesNames() : \string[]

Returns

\string[]

Returns the contained node.

getNode() : \DOMElement
Inherited

inherited_from \phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Abstract::getNode()

Returns

Returns the name of th super class (if any)

getSuperclassName() : string

Returns

string

Traverse through each parent interface and class and inherit its children.

inherit(null $parent) : void

Parameters

$parent

null

is not used in this method. Only there because it is required by the parent class.

Sets the nodes.

setNodes(\phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Class[] $nodes) 
Inherited

inherited_from \phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Abstract::setNodes()

Parameters

$nodes

\phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Class[]

&$nodes Associative array containing all class/interface type nodes.

Returns the elements with the given tag name that can be found as direct children of $node.

getDirectElementsByTagName(\DOMElement | \InheritClass $node, string $element_name) : \DOMElement[]
Inherited

getElementsByTagName returns all DOMElements with the given tag name regardless where in the DOM subtree they are. This method checks whether the parent node matches the given node and thus determines whether it is a direct child.

inherited_from \phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Abstract::getDirectElementsByTagName()

Parameters

$node

\DOMElement\InheritClass

Node to search in.

$element_name

string

Name of the element to find.

Returns

Imports a method that is obtained via reflection.

importReflectedMethod(ReflectionMethod $method) : \DOMElement | null

see \self::reflectInternalClass

Parameters

$method

\ReflectionMethod

Method that is to be imported.

Returns

Inherits the given parent as if it was an class.

inheritClassObject(phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Class $parent) : void

todo this method and inheritInterface should be separated into different objects

Parameters

Inherits all constants from a given base class.

inheritConstants(phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Class $parent) : void

Parameters

$parent

\phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Class

parent object to inherit constants from.

Inherits the given parent as if it was an interface.

inheritInterfaceObject(phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Class $parent) : void

todo this method and inheritClass should be separated into different objects

Parameters

Inherits all methods from the given parent class.

inheritMethods(phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Class $parent) : void

Parameters

$parent

\phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Class

parent object to inherit methods from.

Inherits all properties from a given base class.

inheritProperties(phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Class $parent) : void

Parameters

$parent

\phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Class

parent object to inherit properties from.

Reflect an external class and inherit its children.

reflectExternalClass(string $parent_class_name) : void

This method is used when the parent class is not any of the files that were parsed by phpDocumentor but is obtainable in the path. For these files we want to import their methods so that the overview is complete. Examples of such classes are classes that are in PHP Core (i.e. Exception) or available via PECL extensions.

todo consider moving this to a separate object?

Parameters

$parent_class_name

string

FQCL of the external class.

 Properties

 

Determines whether the inheritance for this class has already been processed.

$is_processed : bool

This is used for the algorythm that build the inheritance tree; whenever this class is instructed to start inheriting it will first check whether its parent interfaces and classes are processed. If not then those are processed first; by always processing the parents first you get a recursive algorythm where independent of your starting class you always end up with a bottom-to-top population mechanism. A positive side-effect is that no class is processed multiple times; optimizing performance.

 

$node

$node : \DOMElement
Inherited

inherited_from \phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Abstract::$$node
 

$nodes

$nodes : \phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Class[]
Inherited

inherited_from \phpDocumentor_Plugin_Core_Transformer_Behaviour_Inherit_Node_Abstract::$$nodes