PHPParser.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\PHPParser
                            [name] => PHPParser
                            [declaration] => class PHPParser
                            [properties] => Array
                                (
                                    [0] => Array
                                        (
                                            [type] => property
                                            [modifiers] => Array
                                                (
                                                    [0] => protected
                                                    [1] => string
                                                )

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => The source HTML + PHP code

                                                    [attribute] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [type] => attribute
                                                                    [name] => var
                                                                    [description] => string
                                                                )

                                                        )

                                                )

                                            [name] => src
                                            [declaration] => protected string $src;
                                        )

                                    [1] => Array
                                        (
                                            [type] => property
                                            [modifiers] => Array
                                                (
                                                    [0] => protected
                                                    [1] => object
                                                )

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => The parsed pieces of code in the format:
 [
     'html' => '<div>A string of code with php placeholders like <b>phpadsfwefhaksldfjaskdlfjaskldfjasldfkphp</b> </div> and trailing text...',
     'php'  => [
         'phpadsfwefhaksldfjaskdlfjaskldfjasldfkphp' => '<?="Something echod";?>', 
         'phpid2'=>'<?php // another code block/?>'
     ]
 ]
The array is simply (object) cast
                                                )

                                            [name] => pieces
                                            [declaration] => protected object $pieces;
                                        )

                                )

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

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

                                                )

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => Create a new PHP parser instance from a string

                                                    [attribute] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [type] => attribute
                                                                    [name] => param
                                                                    [description] => mixed $htmlPHPString - a block of HTML + PHP code. PHP code will be inside open (<?php or <?=) and close (?>) tags
                                                                )

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

                                                        )

                                                )

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

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

                                            [declaration] => public function __construct(string $htmlPHPString)
                                        )

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

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => Return the parsed pieces. See doc for protected $pieces

                                                    [attribute] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [type] => attribute
                                                                    [name] => return
                                                                    [description] => object
                                                                )

                                                        )

                                                )

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

                                            [name] => pieces
                                            [return_types] => Array
                                                (
                                                    [0] => object
                                                )

                                            [body] => Array
                                                (
                                                )

                                            [declaration] => public function pieces(): object
                                        )

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

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => Separate the source code into it's pieces. See the protected $pieces docs
                                                    [attribute] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [type] => attribute
                                                                    [name] => return
                                                                    [description] => object just an array cast to object
                                                                )

                                                        )

                                                )

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

                                            [name] => separatePHP
                                            [return_types] => Array
                                                (
                                                    [0] => object
                                                )

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

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

                                                )

                                            [declaration] => protected function separatePHP(): object
                                        )

                                    [3] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [type] => arg
                                                            [name] => length
                                                            [value] => 26
                                                            [declaration] => $length = 26
                                                        )

                                                )

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => Generates a random string of characters a-z, all lowercase & returns them
 this is used for the PHP placeholders

                                                    [attribute] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [type] => attribute
                                                                    [name] => param
                                                                    [description] => int $length
                                                                )

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

                                                        )

                                                )

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

                                            [name] => randomAlpha
                                            [return_types] => Array
                                                (
                                                    [0] => string
                                                )

                                            [body] => Array
                                                (
                                                )

                                            [declaration] => protected function randomAlpha($length = 26): string
                                        )

                                    [4] => Array
                                        (
                                            [type] => method
                                            [args] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [type] => arg
                                                            [name] => length
                                                            [value] => 26
                                                            [declaration] => $length = 26
                                                        )

                                                )

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => Generates a random string of characters a-z, all lowercase & returns them
 this is used for the PHP placeholders

                                                    [attribute] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [type] => attribute
                                                                    [name] => param
                                                                    [description] => int $length
                                                                )

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

                                                        )

                                                )

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

                                            [name] => getRandomAlpha
                                            [return_types] => Array
                                                (
                                                    [0] => string
                                                )

                                            [body] => Array
                                                (
                                                )

                                            [declaration] => static public function getRandomAlpha($length = 26): string
                                        )

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

                                            [docblock] => Array
                                                (
                                                    [type] => docblock
                                                    [description] => Tokenize the src code into a slightly better format than token_get_all

                                                    [attribute] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [type] => attribute
                                                                    [name] => return
                                                                    [description] => array of tokens
                                                                )

                                                        )

                                                )

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

                                            [name] => tokens
                                            [return_types] => Array
                                                (
                                                    [0] => array
                                                )

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

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

                                                )

                                            [declaration] => protected function tokens(): array
                                        )

                                )

                        )

                )

        )

)