Node.printr.js

Array
(
    [type] => file
    [namespace] => Array
        (
            [type] => namespace
            [name] => Taeluf\PHTML
            [declaration] => namespace Taeluf\PHTML;
            [class] => Array
                (
                    [0] => Array
                        (
                            [type] => class
                            [namespace] => Taeluf\PHTML
                            [fqn] => Taeluf\PHTML\Node
                            [name] => Node
                            [extends] => \DOMElement
                            [declaration] => class Node extends \DOMElement
                            [comments] => Array
                                (
                                    [0] => public $hideOwnTag = false;
                                    [1] => protected $children = [];
                                    [2] => 
                                )

                            [methods] => Array
                                (
                                    [0] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => __construct
                                            [body] => Array
                                                (
                                                )

                                            [declaration] => public function __construct()
                                        )

                                    [1] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [type] => arg
                                                            [arg_types] => Array
                                                                (
                                                                    [0] => string
                                                                )

                                                            [name] => tagName
                                                            [declaration] => string $tagName
                                                        )

                                                )

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => is this node the given tag
                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => is
                                            [return_types] => Array
                                                (
                                                    [0] => bool
                                                )

                                            [body] => Array
                                                (
                                                )

                                            [declaration] => public function is(string $tagName): bool
                                        )

                                    [2] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [type] => arg
                                                            [arg_types] => Array
                                                                (
                                                                    [0] => string
                                                                )

                                                            [name] => attribute
                                                            [declaration] => string $attribute
                                                        )

                                                )

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => 
                                                    [attribute] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [type] => attribute
                                                                    [name] => alias
                                                                    [description] => for DOMDocument::hasAttribute();
                                                                )

                                                        )

                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => has
                                            [return_types] => Array
                                                (
                                                    [0] => bool
                                                )

                                            [body] => Array
                                                (
                                                )

                                            [declaration] => public function has(string $attribute): bool
                                        )

                                    [3] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                )

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => get an array of DOMAttrs on this node
                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => attributes
                                            [body] => Tlf\Lexer\StringAst Object
                                                (
                                                    [_path:protected] => 
                                                    [_name:protected] => 
                                                    [_ext:protected] => 
                                                    [_source] => 
                                                    [_tree:protected] => Array
                                                        (
                                                            [type] => array
                                                        )

                                                    [_type] => array
                                                    [passthrough:protected] => Array
                                                        (
                                                        )

                                                )

                                            [declaration] => public function attributes()
                                        )

                                    [4] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                )

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => return an array of attributes ['attributeName'=>'value', ...];
                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => attributesAsArray
                                            [body] => Tlf\Lexer\StringAst Object
                                                (
                                                    [_path:protected] => 
                                                    [_name:protected] => 
                                                    [_ext:protected] => 
                                                    [_source] => 
                                                    [_tree:protected] => Array
                                                        (
                                                            [type] => array
                                                        )

                                                    [_type] => array
                                                    [passthrough:protected] => Array
                                                        (
                                                        )

                                                )

                                            [declaration] => public function attributesAsArray()
                                        )

                                    [5] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [type] => arg
                                                            [name] => name
                                                            [declaration] => $name
                                                        )

                                                    [1] => Array
                                                        (
                                                            [type] => arg
                                                            [name] => value
                                                            [declaration] => $value
                                                        )

                                                )

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => Used for setting innerHTML like it's done in JavaScript:
@code
$div->innerHTML = '<h2>Chapter 2</h2><p>The story begins...</p>';
@endcode
                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => __set
                                            [body] => Array
                                                (
                                                )

                                            [declaration] => public function __set($name, $value)
                                        )

                                    [6] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [type] => arg
                                                            [name] => name
                                                            [declaration] => $name
                                                        )

                                                )

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => if the node has the named attribute, it will be removed. Otherwise, nothing happens
                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => __unset
                                            [body] => Array
                                                (
                                                )

                                            [declaration] => public function __unset($name)
                                        )

                                    [7] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [type] => arg
                                                            [name] => name
                                                            [declaration] => $name
                                                        )

                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => __isset
                                            [body] => Array
                                                (
                                                )

                                            [declaration] => public function __isset($name)
                                        )

                                    [8] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [type] => arg
                                                            [name] => name
                                                            [declaration] => $name
                                                        )

                                                )

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => Used for getting innerHTML like it's done in JavaScript:
@code
$string = $div->innerHTML;
@endcode
                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => __get
                                            [body] => Array
                                                (
                                                )

                                            [declaration] => public function __get($name)
                                        )

                                    [9] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => __toString
                                            [body] => Array
                                                (
                                                )

                                            [declaration] => public function __toString()
                                        )

                                    [10] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [type] => arg
                                                            [name] => xpath
                                                            [declaration] => $xpath
                                                        )

                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => xpath
                                            [body] => Array
                                                (
                                                )

                                            [declaration] => public function xpath($xpath)
                                        )

                                    [11] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [type] => arg
                                                            [name] => inputName
                                                            [declaration] => $inputName
                                                        )

                                                    [1] => Array
                                                        (
                                                            [type] => arg
                                                            [name] => value
                                                            [declaration] => $value
                                                        )

                                                )

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => Adds a hidden input to a form node
If a hidden input already exists with that name, do nothing
If a hidden input does not exist with that name, create and append it

                                                    [attribute] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [type] => attribute
                                                                    [name] => param
                                                                    [description] => mixed $key
                                                                )

                                                            [1] => Array
                                                                (
                                                                    [type] => attribute
                                                                    [name] => param
                                                                    [description] => mixed $value
                                                                )

                                                            [2] => Array
                                                                (
                                                                    [type] => attribute
                                                                    [name] => throws
                                                                    [description] => \BadMethodCallException if this method is called on a non-form node
                                                                )

                                                            [3] => Array
                                                                (
                                                                    [type] => attribute
                                                                    [name] => return
                                                                    [description] => void
                                                                )

                                                        )

                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => addHiddenInput
                                            [body] => Array
                                                (
                                                )

                                            [declaration] => public function addHiddenInput($inputName, $value)
                                        )

                                    [12] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [type] => arg
                                                            [name] => attributeName
                                                            [declaration] => $attributeName
                                                        )

                                                )

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => Find out if this node has a true value for the given attribute name.
Literally just returns $this->hasAttribute($attributeName)

I wanted to implement an attribute="false" option... but that goes against the standards of HTML5, so that idea is on hold.

See https://stackoverflow.com/questions/4139786/what-does-it-mean-in-html-5-when-an-attribute-is-a-boolean-attribute 

                                                    [attribute] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [type] => attribute
                                                                    [name] => param
                                                                    [description] => mixed $attributeName The name of the attribute we're checking for.
                                                                )

                                                            [1] => Array
                                                                (
                                                                    [type] => attribute
                                                                    [name] => return
                                                                    [description] => bool
                                                                )

                                                        )

                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => boolAttribute
                                            [body] => Array
                                                (
                                                )

                                            [declaration] => public function boolAttribute($attributeName)
                                        )

                                    [13] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => getInnerText
                                            [body] => Array
                                                (
                                                )

                                            [declaration] => public function getInnerText()
                                        )

                                    [14] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [type] => arg
                                                            [name] => method
                                                            [declaration] => $method
                                                        )

                                                    [1] => Array
                                                        (
                                                            [type] => arg
                                                            [name] => args
                                                            [declaration] => $args
                                                        )

                                                )

                                            [modifiers] => Array
                                                (
                                                    [0] => public
                                                )

                                            [name] => __call
                                            [body] => Array
                                                (
                                                )

                                            [declaration] => public function __call($method, $args)
                                        )

                                )

                        )

                )

        )

)