├── README.md ├── TestProject ├── ASTmainForTest.php ├── CrossParseTest.php ├── README.md ├── VulnerabilityTest │ ├── branch_test │ │ ├── if-else.php │ │ ├── if-no_else.php │ │ ├── readme.md │ │ ├── switch-default.php │ │ ├── switch-no_default.php │ │ └── try-catch.php │ ├── crossfile_test │ │ ├── 1.php │ │ ├── 2.php │ │ ├── 3.php │ │ └── main.php │ ├── rce │ │ └── rce.php │ ├── sanitizer_test │ │ └── sanitizer_test.php │ ├── sql注入 │ │ ├── 1.php │ │ ├── 2.php │ │ └── 3.php │ ├── think │ └── transfer_test │ │ └── transfer_test.php └── test.php ├── analyze.php ├── analyze_func.php ├── assets ├── css │ └── bootstrap.min.css └── js │ ├── bootstrap.min.js │ ├── jquery-3.4.1.js │ └── jquery-3.4.1.min.js ├── composer.json ├── composer.lock ├── config ├── AstToIrConverter.php ├── TaintFlowAnalysisCore.php ├── analysis │ ├── Sanitizer.php │ ├── Sink.php │ ├── Source.php │ └── TaintAnalyzer.php ├── control_flow │ ├── BasicBlockHandler.php │ └── CFGBuilder.php └── utils │ ├── FuncTable.php │ └── Visitor.php ├── favicon.ico ├── global.php ├── index.php └── vendor ├── autoload.php ├── bin ├── php-parse └── php-parse.bat ├── composer ├── ClassLoader.php ├── InstalledVersions.php ├── LICENSE ├── autoload_classmap.php ├── autoload_namespaces.php ├── autoload_psr4.php ├── autoload_real.php ├── autoload_static.php ├── installed.json ├── installed.php └── platform_check.php └── nikic └── php-parser ├── LICENSE ├── README.md ├── bin └── php-parse ├── composer.json └── lib └── PhpParser ├── Builder.php ├── Builder ├── ClassConst.php ├── Class_.php ├── Declaration.php ├── EnumCase.php ├── Enum_.php ├── FunctionLike.php ├── Function_.php ├── Interface_.php ├── Method.php ├── Namespace_.php ├── Param.php ├── Property.php ├── TraitUse.php ├── TraitUseAdaptation.php ├── Trait_.php └── Use_.php ├── BuilderFactory.php ├── BuilderHelpers.php ├── Comment.php ├── Comment └── Doc.php ├── ConstExprEvaluationException.php ├── ConstExprEvaluator.php ├── Error.php ├── ErrorHandler.php ├── ErrorHandler ├── Collecting.php └── Throwing.php ├── Internal ├── DiffElem.php ├── Differ.php ├── PrintableNewAnonClassNode.php └── TokenStream.php ├── JsonDecoder.php ├── Lexer.php ├── Lexer ├── Emulative.php └── TokenEmulator │ ├── AttributeEmulator.php │ ├── CoaleseEqualTokenEmulator.php │ ├── EnumTokenEmulator.php │ ├── ExplicitOctalEmulator.php │ ├── FlexibleDocStringEmulator.php │ ├── FnTokenEmulator.php │ ├── KeywordEmulator.php │ ├── MatchTokenEmulator.php │ ├── NullsafeTokenEmulator.php │ ├── NumericLiteralSeparatorEmulator.php │ ├── ReadonlyFunctionTokenEmulator.php │ ├── ReadonlyTokenEmulator.php │ ├── ReverseEmulator.php │ └── TokenEmulator.php ├── NameContext.php ├── Node.php ├── Node ├── Arg.php ├── Attribute.php ├── AttributeGroup.php ├── ComplexType.php ├── Const_.php ├── Expr.php ├── Expr │ ├── ArrayDimFetch.php │ ├── ArrayItem.php │ ├── Array_.php │ ├── ArrowFunction.php │ ├── Assign.php │ ├── AssignOp.php │ ├── AssignOp │ │ ├── BitwiseAnd.php │ │ ├── BitwiseOr.php │ │ ├── BitwiseXor.php │ │ ├── Coalesce.php │ │ ├── Concat.php │ │ ├── Div.php │ │ ├── Minus.php │ │ ├── Mod.php │ │ ├── Mul.php │ │ ├── Plus.php │ │ ├── Pow.php │ │ ├── ShiftLeft.php │ │ └── ShiftRight.php │ ├── AssignRef.php │ ├── BinaryOp.php │ ├── BinaryOp │ │ ├── BitwiseAnd.php │ │ ├── BitwiseOr.php │ │ ├── BitwiseXor.php │ │ ├── BooleanAnd.php │ │ ├── BooleanOr.php │ │ ├── Coalesce.php │ │ ├── Concat.php │ │ ├── Div.php │ │ ├── Equal.php │ │ ├── Greater.php │ │ ├── GreaterOrEqual.php │ │ ├── Identical.php │ │ ├── LogicalAnd.php │ │ ├── LogicalOr.php │ │ ├── LogicalXor.php │ │ ├── Minus.php │ │ ├── Mod.php │ │ ├── Mul.php │ │ ├── NotEqual.php │ │ ├── NotIdentical.php │ │ ├── Plus.php │ │ ├── Pow.php │ │ ├── ShiftLeft.php │ │ ├── ShiftRight.php │ │ ├── Smaller.php │ │ ├── SmallerOrEqual.php │ │ └── Spaceship.php │ ├── BitwiseNot.php │ ├── BooleanNot.php │ ├── CallLike.php │ ├── Cast.php │ ├── Cast │ │ ├── Array_.php │ │ ├── Bool_.php │ │ ├── Double.php │ │ ├── Int_.php │ │ ├── Object_.php │ │ ├── String_.php │ │ └── Unset_.php │ ├── ClassConstFetch.php │ ├── Clone_.php │ ├── Closure.php │ ├── ClosureUse.php │ ├── ConstFetch.php │ ├── Empty_.php │ ├── Error.php │ ├── ErrorSuppress.php │ ├── Eval_.php │ ├── Exit_.php │ ├── FuncCall.php │ ├── Include_.php │ ├── Instanceof_.php │ ├── Isset_.php │ ├── List_.php │ ├── Match_.php │ ├── MethodCall.php │ ├── New_.php │ ├── NullsafeMethodCall.php │ ├── NullsafePropertyFetch.php │ ├── PostDec.php │ ├── PostInc.php │ ├── PreDec.php │ ├── PreInc.php │ ├── Print_.php │ ├── PropertyFetch.php │ ├── ShellExec.php │ ├── StaticCall.php │ ├── StaticPropertyFetch.php │ ├── Ternary.php │ ├── Throw_.php │ ├── UnaryMinus.php │ ├── UnaryPlus.php │ ├── Variable.php │ ├── YieldFrom.php │ └── Yield_.php ├── FunctionLike.php ├── Identifier.php ├── IntersectionType.php ├── MatchArm.php ├── Name.php ├── Name │ ├── FullyQualified.php │ └── Relative.php ├── NullableType.php ├── Param.php ├── Scalar.php ├── Scalar │ ├── DNumber.php │ ├── Encapsed.php │ ├── EncapsedStringPart.php │ ├── LNumber.php │ ├── MagicConst.php │ ├── MagicConst │ │ ├── Class_.php │ │ ├── Dir.php │ │ ├── File.php │ │ ├── Function_.php │ │ ├── Line.php │ │ ├── Method.php │ │ ├── Namespace_.php │ │ └── Trait_.php │ └── String_.php ├── Stmt.php ├── Stmt │ ├── Break_.php │ ├── Case_.php │ ├── Catch_.php │ ├── ClassConst.php │ ├── ClassLike.php │ ├── ClassMethod.php │ ├── Class_.php │ ├── Const_.php │ ├── Continue_.php │ ├── DeclareDeclare.php │ ├── Declare_.php │ ├── Do_.php │ ├── Echo_.php │ ├── ElseIf_.php │ ├── Else_.php │ ├── EnumCase.php │ ├── Enum_.php │ ├── Expression.php │ ├── Finally_.php │ ├── For_.php │ ├── Foreach_.php │ ├── Function_.php │ ├── Global_.php │ ├── Goto_.php │ ├── GroupUse.php │ ├── HaltCompiler.php │ ├── If_.php │ ├── InlineHTML.php │ ├── Interface_.php │ ├── Label.php │ ├── Namespace_.php │ ├── Nop.php │ ├── Property.php │ ├── PropertyProperty.php │ ├── Return_.php │ ├── StaticVar.php │ ├── Static_.php │ ├── Switch_.php │ ├── Throw_.php │ ├── TraitUse.php │ ├── TraitUseAdaptation.php │ ├── TraitUseAdaptation │ │ ├── Alias.php │ │ └── Precedence.php │ ├── Trait_.php │ ├── TryCatch.php │ ├── Unset_.php │ ├── UseUse.php │ ├── Use_.php │ └── While_.php ├── UnionType.php ├── VarLikeIdentifier.php └── VariadicPlaceholder.php ├── NodeAbstract.php ├── NodeDumper.php ├── NodeFinder.php ├── NodeTraverser.php ├── NodeTraverserInterface.php ├── NodeVisitor.php ├── NodeVisitor ├── CloningVisitor.php ├── FindingVisitor.php ├── FirstFindingVisitor.php ├── NameResolver.php ├── NodeConnectingVisitor.php └── ParentConnectingVisitor.php ├── NodeVisitorAbstract.php ├── Parser.php ├── Parser ├── Multiple.php ├── Php5.php ├── Php7.php └── Tokens.php ├── ParserAbstract.php ├── ParserFactory.php ├── PrettyPrinter └── Standard.php └── PrettyPrinterAbstract.php /TestProject/ASTmainForTest.php: -------------------------------------------------------------------------------- 1 | parse($code); 26 | $NodeInitVisitor = new NodeInitVisitor(); 27 | $traverser = new PhpParser\NodeTraverser(); 28 | $traverser->addVisitor($NodeInitVisitor); 29 | $traverser->traverse($parseResult); 30 | 31 | $nodes = $NodeInitVisitor->getNodes(); 32 | $AstToIrConverter = new AstToIrConverter(); 33 | $quads = $AstToIrConverter->AstParse($nodes); //返回四元组 34 | $quad_id = count($quads); //quad总数 35 | $a = 0; 36 | //遍历每一个quad 37 | for ($i = 1; $i < $quad_id; $i++) { 38 | 39 | //分支语句整体的开始 40 | if ($quads[$i]->opcode == "Stmt_Branch_Start") { 41 | $a++; 42 | } 43 | } 44 | var_dump($a); 45 | $flow_graph = new ControlFlowGraph(); 46 | $flow_graph->process($quads); 47 | 48 | // var_dump($parseResult); //AST 49 | // var_dump($AstToIrConverter->funcs); //方法表 50 | // var_dump($quads); //Q_IR 51 | // //var_dump($flow_graph->BasicBlockHandler->BasicBlock); //基本块 52 | // var_dump($flow_graph->CFGBuilder->CFG); //CFG 53 | // var_dump($flow_graph->TaintAnalyzer->varMap); //变量 54 | var_dump($flow_graph->sinks); //污点 55 | } catch (Error $e) { 56 | echo 'Parse Error: ', $e->getMessage(), "\n"; 57 | } 58 | 59 | $endTime = microtime(true); 60 | 61 | //计算耗时 62 | $executionTime = $endTime - $startTime; 63 | echo "Execution Time: " . round($executionTime, 4) . " seconds\n"; 64 | -------------------------------------------------------------------------------- /TestProject/README.md: -------------------------------------------------------------------------------- 1 | VulnerabilityTest目录是一些测试漏洞的代码 2 | 3 | ASTmainForTest.php(用于单文件)和CrossParseTest.php(用于跨文件的函数解析)都是开发过程中使用的测试代码,可以看到他读取了test.php进行处理,核心逻辑是 4 | 5 | ``` 6 | var_dump($parseResult); //AST 7 | var_dump($quads); //Q_IR 8 | var_dump($flow_graph->BasicBlockHandler->BasicBlock); //基本块 9 | var_dump($flow_graph->CFGBuilder->CFG); //CFG 10 | var_dump($flow_graph->TaintAnalyzer->varMap); //变量 11 | var_dump($flow_graph->sinks); //污点 12 | ``` 13 | 14 | 可以输出代码运行过程中产生的AST、IR、基本块、CFG、变量表和污点,便于调试 -------------------------------------------------------------------------------- /TestProject/VulnerabilityTest/branch_test/if-else.php: -------------------------------------------------------------------------------- 1 | 42 | ``` 43 | 44 | 没有else的情况下,if elseif是一条流,由于不存在else,因此还应当存在一条不经过if语句的流 45 | 46 | ``` 47 | 56 | ``` 57 | 58 | ## switch 59 | 60 | 分为两种情况,有default和没有default 61 | 62 | 注意 case和default本质没有不同,只是default没有条件 63 | 64 | 有default时,case和default分别是一条流 65 | 66 | ``` 67 | 78 | ``` 79 | 80 | 没有default时,注意还存在一条不经过switch的流 81 | 82 | ``` 83 | 92 | ``` 93 | 94 | -------------------------------------------------------------------------------- /TestProject/VulnerabilityTest/branch_test/switch-default.php: -------------------------------------------------------------------------------- 1 | query($sql); 15 | $conn->query($result); 16 | } catch (PDOException $e) { 17 | showmessage(-1, '数据库错误:' . $e->getMessage()); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /TestProject/VulnerabilityTest/sql注入/3.php: -------------------------------------------------------------------------------- 1 | 编辑弹幕($cid) ?: succeedmsg(0, '完成'); 4 | -------------------------------------------------------------------------------- /TestProject/VulnerabilityTest/think: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fushuling/TaintScaner/5eb01f8affbcbe0a5edb8ee2ba91bda3100619da/TestProject/VulnerabilityTest/think -------------------------------------------------------------------------------- /TestProject/VulnerabilityTest/transfer_test/transfer_test.php: -------------------------------------------------------------------------------- 1 | query($cid); 4 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "nikic/php-parser": "^4.2" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /config/analysis/Sanitizer.php: -------------------------------------------------------------------------------- 1 | = $maxDepth) { 17 | trigger_error("Maximum recursion depth ($maxDepth) reached in GetUserInput", E_USER_WARNING); 18 | return []; 19 | } 20 | 21 | $callDepth++; // 递归深度加1 22 | 23 | try { 24 | $result = self::$userInput; 25 | } catch (Exception $e) { 26 | // 捕获可能的异常,防止程序崩溃 27 | trigger_error("Error in GetUserInput: " . $e->getMessage(), E_USER_WARNING); 28 | $result = []; 29 | } 30 | 31 | $callDepth--; // 递归深度减1 32 | return $result; 33 | } 34 | 35 | //用户输入参数 36 | public static $userInput = array( 37 | '_GET', 38 | '_POST', 39 | '_COOKIE', 40 | '_REQUEST', 41 | '_SERVER', 42 | '_ENV', 43 | '_SESSION' 44 | ); 45 | } 46 | -------------------------------------------------------------------------------- /config/utils/FuncTable.php: -------------------------------------------------------------------------------- 1 | func_name = $func_name; 18 | $this->func_param = $func_param; 19 | $this->func_stmt = $func_stmt; 20 | $this->file_path = $file_path; // 将文件路径赋值给类属性 21 | $this->flag = $flag; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /config/utils/Visitor.php: -------------------------------------------------------------------------------- 1 | nodes = $nodes ; 10 | } 11 | //提供获取这些节点的接口 12 | public function getNodes(){ 13 | return $this->nodes ; 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fushuling/TaintScaner/5eb01f8affbcbe0a5edb8ee2ba91bda3100619da/favicon.ico -------------------------------------------------------------------------------- /global.php: -------------------------------------------------------------------------------- 1 | Q_IR 6 | require 'config/TaintFlowAnalysisCore.php'; //污点分析核心逻辑 7 | 8 | require 'config/analysis/Sink.php'; 9 | require 'config/analysis/Source.php'; 10 | require 'config/analysis/TaintAnalyzer.php'; 11 | require 'config/analysis/Sanitizer.php'; 12 | 13 | require 'config/control_flow/BasicBlockHandler.php'; 14 | require 'config/control_flow/CFGBuilder.php'; 15 | 16 | 17 | require 'config/utils/Visitor.php'; 18 | require 'config/utils/FuncTable.php'; 19 | -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/composer/InstalledVersions.php', 10 | ); 11 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/nikic/php-parser/lib/PhpParser'), 10 | ); 11 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | register(true); 35 | 36 | return $loader; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | 11 | array ( 12 | 'PhpParser\\' => 10, 13 | ), 14 | ); 15 | 16 | public static $prefixDirsPsr4 = array ( 17 | 'PhpParser\\' => 18 | array ( 19 | 0 => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser', 20 | ), 21 | ); 22 | 23 | public static $classMap = array ( 24 | 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 25 | ); 26 | 27 | public static function getInitializer(ClassLoader $loader) 28 | { 29 | return \Closure::bind(function () use ($loader) { 30 | $loader->prefixLengthsPsr4 = ComposerStaticInit2e49afaa0b65ddf0f5750ceeba7b0334::$prefixLengthsPsr4; 31 | $loader->prefixDirsPsr4 = ComposerStaticInit2e49afaa0b65ddf0f5750ceeba7b0334::$prefixDirsPsr4; 32 | $loader->classMap = ComposerStaticInit2e49afaa0b65ddf0f5750ceeba7b0334::$classMap; 33 | 34 | }, null, ClassLoader::class); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/composer/installed.php: -------------------------------------------------------------------------------- 1 | array( 3 | 'name' => '__root__', 4 | 'pretty_version' => '1.0.0+no-version-set', 5 | 'version' => '1.0.0.0', 6 | 'reference' => null, 7 | 'type' => 'library', 8 | 'install_path' => __DIR__ . '/../../', 9 | 'aliases' => array(), 10 | 'dev' => true, 11 | ), 12 | 'versions' => array( 13 | '__root__' => array( 14 | 'pretty_version' => '1.0.0+no-version-set', 15 | 'version' => '1.0.0.0', 16 | 'reference' => null, 17 | 'type' => 'library', 18 | 'install_path' => __DIR__ . '/../../', 19 | 'aliases' => array(), 20 | 'dev_requirement' => false, 21 | ), 22 | 'nikic/php-parser' => array( 23 | 'pretty_version' => 'v4.19.4', 24 | 'version' => '4.19.4.0', 25 | 'reference' => '715f4d25e225bc47b293a8b997fe6ce99bf987d2', 26 | 'type' => 'library', 27 | 'install_path' => __DIR__ . '/../nikic/php-parser', 28 | 'aliases' => array(), 29 | 'dev_requirement' => false, 30 | ), 31 | ), 32 | ); 33 | -------------------------------------------------------------------------------- /vendor/composer/platform_check.php: -------------------------------------------------------------------------------- 1 | = 70100)) { 8 | $issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.'; 9 | } 10 | 11 | if ($issues) { 12 | if (!headers_sent()) { 13 | header('HTTP/1.1 500 Internal Server Error'); 14 | } 15 | if (!ini_get('display_errors')) { 16 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { 17 | fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); 18 | } elseif (!headers_sent()) { 19 | echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; 20 | } 21 | } 22 | trigger_error( 23 | 'Composer detected issues in your platform: ' . implode(' ', $issues), 24 | E_USER_ERROR 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2011, Nikita Popov 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nikic/php-parser", 3 | "type": "library", 4 | "description": "A PHP parser written in PHP", 5 | "keywords": [ 6 | "php", 7 | "parser" 8 | ], 9 | "license": "BSD-3-Clause", 10 | "authors": [ 11 | { 12 | "name": "Nikita Popov" 13 | } 14 | ], 15 | "require": { 16 | "php": ">=7.1", 17 | "ext-tokenizer": "*" 18 | }, 19 | "require-dev": { 20 | "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", 21 | "ircmaxell/php-yacc": "^0.0.7" 22 | }, 23 | "extra": { 24 | "branch-alias": { 25 | "dev-master": "4.9-dev" 26 | } 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "PhpParser\\": "lib/PhpParser" 31 | } 32 | }, 33 | "autoload-dev": { 34 | "psr-4": { 35 | "PhpParser\\": "test/PhpParser/" 36 | } 37 | }, 38 | "bin": [ 39 | "bin/php-parse" 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Builder.php: -------------------------------------------------------------------------------- 1 | addStmt($stmt); 24 | } 25 | 26 | return $this; 27 | } 28 | 29 | /** 30 | * Sets doc comment for the declaration. 31 | * 32 | * @param PhpParser\Comment\Doc|string $docComment Doc comment to set 33 | * 34 | * @return $this The builder instance (for fluid interface) 35 | */ 36 | public function setDocComment($docComment) { 37 | $this->attributes['comments'] = [ 38 | BuilderHelpers::normalizeDocComment($docComment) 39 | ]; 40 | 41 | return $this; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php: -------------------------------------------------------------------------------- 1 | name = $name; 29 | } 30 | 31 | /** 32 | * Sets the value. 33 | * 34 | * @param Node\Expr|string|int $value 35 | * 36 | * @return $this 37 | */ 38 | public function setValue($value) { 39 | $this->value = BuilderHelpers::normalizeValue($value); 40 | 41 | return $this; 42 | } 43 | 44 | /** 45 | * Sets doc comment for the constant. 46 | * 47 | * @param PhpParser\Comment\Doc|string $docComment Doc comment to set 48 | * 49 | * @return $this The builder instance (for fluid interface) 50 | */ 51 | public function setDocComment($docComment) { 52 | $this->attributes = [ 53 | 'comments' => [BuilderHelpers::normalizeDocComment($docComment)] 54 | ]; 55 | 56 | return $this; 57 | } 58 | 59 | /** 60 | * Adds an attribute group. 61 | * 62 | * @param Node\Attribute|Node\AttributeGroup $attribute 63 | * 64 | * @return $this The builder instance (for fluid interface) 65 | */ 66 | public function addAttribute($attribute) { 67 | $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); 68 | 69 | return $this; 70 | } 71 | 72 | /** 73 | * Returns the built enum case node. 74 | * 75 | * @return Stmt\EnumCase The built constant node 76 | */ 77 | public function getNode(): PhpParser\Node { 78 | return new Stmt\EnumCase( 79 | $this->name, 80 | $this->value, 81 | $this->attributeGroups, 82 | $this->attributes 83 | ); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php: -------------------------------------------------------------------------------- 1 | returnByRef = true; 23 | 24 | return $this; 25 | } 26 | 27 | /** 28 | * Adds a parameter. 29 | * 30 | * @param Node\Param|Param $param The parameter to add 31 | * 32 | * @return $this The builder instance (for fluid interface) 33 | */ 34 | public function addParam($param) { 35 | $param = BuilderHelpers::normalizeNode($param); 36 | 37 | if (!$param instanceof Node\Param) { 38 | throw new \LogicException(sprintf('Expected parameter node, got "%s"', $param->getType())); 39 | } 40 | 41 | $this->params[] = $param; 42 | 43 | return $this; 44 | } 45 | 46 | /** 47 | * Adds multiple parameters. 48 | * 49 | * @param array $params The parameters to add 50 | * 51 | * @return $this The builder instance (for fluid interface) 52 | */ 53 | public function addParams(array $params) { 54 | foreach ($params as $param) { 55 | $this->addParam($param); 56 | } 57 | 58 | return $this; 59 | } 60 | 61 | /** 62 | * Sets the return type for PHP 7. 63 | * 64 | * @param string|Node\Name|Node\Identifier|Node\ComplexType $type 65 | * 66 | * @return $this The builder instance (for fluid interface) 67 | */ 68 | public function setReturnType($type) { 69 | $this->returnType = BuilderHelpers::normalizeType($type); 70 | 71 | return $this; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php: -------------------------------------------------------------------------------- 1 | name = $name; 25 | } 26 | 27 | /** 28 | * Adds a statement. 29 | * 30 | * @param Node|PhpParser\Builder $stmt The statement to add 31 | * 32 | * @return $this The builder instance (for fluid interface) 33 | */ 34 | public function addStmt($stmt) { 35 | $this->stmts[] = BuilderHelpers::normalizeStmt($stmt); 36 | 37 | return $this; 38 | } 39 | 40 | /** 41 | * Adds an attribute group. 42 | * 43 | * @param Node\Attribute|Node\AttributeGroup $attribute 44 | * 45 | * @return $this The builder instance (for fluid interface) 46 | */ 47 | public function addAttribute($attribute) { 48 | $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); 49 | 50 | return $this; 51 | } 52 | 53 | /** 54 | * Returns the built function node. 55 | * 56 | * @return Stmt\Function_ The built function node 57 | */ 58 | public function getNode() : Node { 59 | return new Stmt\Function_($this->name, [ 60 | 'byRef' => $this->returnByRef, 61 | 'params' => $this->params, 62 | 'returnType' => $this->returnType, 63 | 'stmts' => $this->stmts, 64 | 'attrGroups' => $this->attributeGroups, 65 | ], $this->attributes); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php: -------------------------------------------------------------------------------- 1 | name = null !== $name ? BuilderHelpers::normalizeName($name) : null; 22 | } 23 | 24 | /** 25 | * Adds a statement. 26 | * 27 | * @param Node|PhpParser\Builder $stmt The statement to add 28 | * 29 | * @return $this The builder instance (for fluid interface) 30 | */ 31 | public function addStmt($stmt) { 32 | $this->stmts[] = BuilderHelpers::normalizeStmt($stmt); 33 | 34 | return $this; 35 | } 36 | 37 | /** 38 | * Returns the built node. 39 | * 40 | * @return Stmt\Namespace_ The built node 41 | */ 42 | public function getNode() : Node { 43 | return new Stmt\Namespace_($this->name, $this->stmts, $this->attributes); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php: -------------------------------------------------------------------------------- 1 | and($trait); 23 | } 24 | } 25 | 26 | /** 27 | * Adds used trait. 28 | * 29 | * @param Node\Name|string $trait Trait name 30 | * 31 | * @return $this The builder instance (for fluid interface) 32 | */ 33 | public function and($trait) { 34 | $this->traits[] = BuilderHelpers::normalizeName($trait); 35 | return $this; 36 | } 37 | 38 | /** 39 | * Adds trait adaptation. 40 | * 41 | * @param Stmt\TraitUseAdaptation|Builder\TraitUseAdaptation $adaptation Trait adaptation 42 | * 43 | * @return $this The builder instance (for fluid interface) 44 | */ 45 | public function with($adaptation) { 46 | $adaptation = BuilderHelpers::normalizeNode($adaptation); 47 | 48 | if (!$adaptation instanceof Stmt\TraitUseAdaptation) { 49 | throw new \LogicException('Adaptation must have type TraitUseAdaptation'); 50 | } 51 | 52 | $this->adaptations[] = $adaptation; 53 | return $this; 54 | } 55 | 56 | /** 57 | * Returns the built node. 58 | * 59 | * @return Node The built node 60 | */ 61 | public function getNode() : Node { 62 | return new Stmt\TraitUse($this->traits, $this->adaptations); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php: -------------------------------------------------------------------------------- 1 | name = BuilderHelpers::normalizeName($name); 24 | $this->type = $type; 25 | } 26 | 27 | /** 28 | * Sets alias for used name. 29 | * 30 | * @param string $alias Alias to use (last component of full name by default) 31 | * 32 | * @return $this The builder instance (for fluid interface) 33 | */ 34 | public function as(string $alias) { 35 | $this->alias = $alias; 36 | return $this; 37 | } 38 | 39 | /** 40 | * Returns the built node. 41 | * 42 | * @return Stmt\Use_ The built node 43 | */ 44 | public function getNode() : Node { 45 | return new Stmt\Use_([ 46 | new Stmt\UseUse($this->name, $this->alias) 47 | ], $this->type); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php: -------------------------------------------------------------------------------- 1 | errors[] = $error; 20 | } 21 | 22 | /** 23 | * Get collected errors. 24 | * 25 | * @return Error[] 26 | */ 27 | public function getErrors() : array { 28 | return $this->errors; 29 | } 30 | 31 | /** 32 | * Check whether there are any errors. 33 | * 34 | * @return bool 35 | */ 36 | public function hasErrors() : bool { 37 | return !empty($this->errors); 38 | } 39 | 40 | /** 41 | * Reset/clear collected errors. 42 | */ 43 | public function clearErrors() { 44 | $this->errors = []; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php: -------------------------------------------------------------------------------- 1 | type = $type; 24 | $this->old = $old; 25 | $this->new = $new; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php: -------------------------------------------------------------------------------- 1 | resolveIntegerOrFloatToken($tokens[$i + 1][1]); 23 | array_splice($tokens, $i, 2, [ 24 | [$tokenKind, '0' . $tokens[$i + 1][1], $tokens[$i][2]], 25 | ]); 26 | $c--; 27 | } 28 | } 29 | return $tokens; 30 | } 31 | 32 | private function resolveIntegerOrFloatToken(string $str): int 33 | { 34 | $str = substr($str, 1); 35 | $str = str_replace('_', '', $str); 36 | $num = octdec($str); 37 | return is_float($num) ? \T_DNUMBER : \T_LNUMBER; 38 | } 39 | 40 | public function reverseEmulate(string $code, array $tokens): array { 41 | // Explicit octals were not legal code previously, don't bother. 42 | return $tokens; 43 | } 44 | } -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php: -------------------------------------------------------------------------------- 1 | getKeywordString()) !== false; 13 | } 14 | 15 | protected function isKeywordContext(array $tokens, int $pos): bool 16 | { 17 | $previousNonSpaceToken = $this->getPreviousNonSpaceToken($tokens, $pos); 18 | return $previousNonSpaceToken === null || $previousNonSpaceToken[0] !== \T_OBJECT_OPERATOR; 19 | } 20 | 21 | public function emulate(string $code, array $tokens): array 22 | { 23 | $keywordString = $this->getKeywordString(); 24 | foreach ($tokens as $i => $token) { 25 | if ($token[0] === T_STRING && strtolower($token[1]) === $keywordString 26 | && $this->isKeywordContext($tokens, $i)) { 27 | $tokens[$i][0] = $this->getKeywordToken(); 28 | } 29 | } 30 | 31 | return $tokens; 32 | } 33 | 34 | /** 35 | * @param mixed[] $tokens 36 | * @return array|string|null 37 | */ 38 | private function getPreviousNonSpaceToken(array $tokens, int $start) 39 | { 40 | for ($i = $start - 1; $i >= 0; --$i) { 41 | if ($tokens[$i][0] === T_WHITESPACE) { 42 | continue; 43 | } 44 | 45 | return $tokens[$i]; 46 | } 47 | 48 | return null; 49 | } 50 | 51 | public function reverseEmulate(string $code, array $tokens): array 52 | { 53 | $keywordToken = $this->getKeywordToken(); 54 | foreach ($tokens as $i => $token) { 55 | if ($token[0] === $keywordToken) { 56 | $tokens[$i][0] = \T_STRING; 57 | } 58 | } 59 | 60 | return $tokens; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php: -------------------------------------------------------------------------------- 1 | emulator = $emulator; 15 | } 16 | 17 | public function getPhpVersion(): string { 18 | return $this->emulator->getPhpVersion(); 19 | } 20 | 21 | public function isEmulationNeeded(string $code): bool { 22 | return $this->emulator->isEmulationNeeded($code); 23 | } 24 | 25 | public function emulate(string $code, array $tokens): array { 26 | return $this->emulator->reverseEmulate($code, $tokens); 27 | } 28 | 29 | public function reverseEmulate(string $code, array $tokens): array { 30 | return $this->emulator->emulate($code, $tokens); 31 | } 32 | 33 | public function preprocessCode(string $code, array &$patches): string { 34 | return $code; 35 | } 36 | } -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 33 | $this->name = $name; 34 | $this->value = $value; 35 | $this->byRef = $byRef; 36 | $this->unpack = $unpack; 37 | } 38 | 39 | public function getSubNodeNames() : array { 40 | return ['name', 'value', 'byRef', 'unpack']; 41 | } 42 | 43 | public function getType() : string { 44 | return 'Arg'; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->name = $name; 24 | $this->args = $args; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['name', 'args']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Attribute'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 19 | $this->attrs = $attrs; 20 | } 21 | 22 | public function getSubNodeNames() : array { 23 | return ['attrs']; 24 | } 25 | 26 | public function getType() : string { 27 | return 'AttributeGroup'; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 26 | $this->name = \is_string($name) ? new Identifier($name) : $name; 27 | $this->value = $value; 28 | } 29 | 30 | public function getSubNodeNames() : array { 31 | return ['name', 'value']; 32 | } 33 | 34 | public function getType() : string { 35 | return 'Const'; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->var = $var; 24 | $this->dim = $dim; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['var', 'dim']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Expr_ArrayDimFetch'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 28 | $this->key = $key; 29 | $this->value = $value; 30 | $this->byRef = $byRef; 31 | $this->unpack = $unpack; 32 | } 33 | 34 | public function getSubNodeNames() : array { 35 | return ['key', 'value', 'byRef', 'unpack']; 36 | } 37 | 38 | public function getType() : string { 39 | return 'Expr_ArrayItem'; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 24 | $this->items = $items; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['items']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Expr_Array'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->var = $var; 24 | $this->expr = $expr; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['var', 'expr']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Expr_Assign'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->var = $var; 24 | $this->expr = $expr; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['var', 'expr']; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->var = $var; 24 | $this->expr = $expr; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['var', 'expr']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Expr_AssignRef'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->left = $left; 24 | $this->right = $right; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['left', 'right']; 29 | } 30 | 31 | /** 32 | * Get the operator sigil for this binary operation. 33 | * 34 | * In the case there are multiple possible sigils for an operator, this method does not 35 | * necessarily return the one used in the parsed code. 36 | * 37 | * @return string 38 | */ 39 | abstract public function getOperatorSigil() : string; 40 | } 41 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php: -------------------------------------------------------------------------------- 1 | '; 11 | } 12 | 13 | public function getType() : string { 14 | return 'Expr_BinaryOp_Greater'; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php: -------------------------------------------------------------------------------- 1 | ='; 11 | } 12 | 13 | public function getType() : string { 14 | return 'Expr_BinaryOp_GreaterOrEqual'; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php: -------------------------------------------------------------------------------- 1 | >'; 11 | } 12 | 13 | public function getType() : string { 14 | return 'Expr_BinaryOp_ShiftRight'; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php: -------------------------------------------------------------------------------- 1 | '; 11 | } 12 | 13 | public function getType() : string { 14 | return 'Expr_BinaryOp_Spaceship'; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->expr = $expr; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['expr']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_BitwiseNot'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->expr = $expr; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['expr']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_BooleanNot'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | abstract public function getRawArgs(): array; 17 | 18 | /** 19 | * Returns whether this call expression is actually a first class callable. 20 | */ 21 | public function isFirstClassCallable(): bool { 22 | foreach ($this->getRawArgs() as $arg) { 23 | if ($arg instanceof VariadicPlaceholder) { 24 | return true; 25 | } 26 | } 27 | return false; 28 | } 29 | 30 | /** 31 | * Assert that this is not a first-class callable and return only ordinary Args. 32 | * 33 | * @return Arg[] 34 | */ 35 | public function getArgs(): array { 36 | assert(!$this->isFirstClassCallable()); 37 | return $this->getRawArgs(); 38 | } 39 | } -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->expr = $expr; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['expr']; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 25 | $this->class = $class; 26 | $this->name = \is_string($name) ? new Identifier($name) : $name; 27 | } 28 | 29 | public function getSubNodeNames() : array { 30 | return ['class', 'name']; 31 | } 32 | 33 | public function getType() : string { 34 | return 'Expr_ClassConstFetch'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->expr = $expr; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['expr']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_Clone'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->var = $var; 24 | $this->byRef = $byRef; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['var', 'byRef']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Expr_ClosureUse'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 21 | $this->name = $name; 22 | } 23 | 24 | public function getSubNodeNames() : array { 25 | return ['name']; 26 | } 27 | 28 | public function getType() : string { 29 | return 'Expr_ConstFetch'; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->expr = $expr; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['expr']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_Empty'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 22 | } 23 | 24 | public function getSubNodeNames() : array { 25 | return []; 26 | } 27 | 28 | public function getType() : string { 29 | return 'Expr_Error'; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->expr = $expr; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['expr']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_ErrorSuppress'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->expr = $expr; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['expr']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_Eval'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 24 | $this->expr = $expr; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['expr']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Expr_Exit'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php: -------------------------------------------------------------------------------- 1 | Arguments */ 13 | public $args; 14 | 15 | /** 16 | * Constructs a function call node. 17 | * 18 | * @param Node\Name|Expr $name Function name 19 | * @param array $args Arguments 20 | * @param array $attributes Additional attributes 21 | */ 22 | public function __construct($name, array $args = [], array $attributes = []) { 23 | $this->attributes = $attributes; 24 | $this->name = $name; 25 | $this->args = $args; 26 | } 27 | 28 | public function getSubNodeNames() : array { 29 | return ['name', 'args']; 30 | } 31 | 32 | public function getType() : string { 33 | return 'Expr_FuncCall'; 34 | } 35 | 36 | public function getRawArgs(): array { 37 | return $this->args; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 28 | $this->expr = $expr; 29 | $this->type = $type; 30 | } 31 | 32 | public function getSubNodeNames() : array { 33 | return ['expr', 'type']; 34 | } 35 | 36 | public function getType() : string { 37 | return 'Expr_Include'; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 24 | $this->expr = $expr; 25 | $this->class = $class; 26 | } 27 | 28 | public function getSubNodeNames() : array { 29 | return ['expr', 'class']; 30 | } 31 | 32 | public function getType() : string { 33 | return 'Expr_Instanceof'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->vars = $vars; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['vars']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_Isset'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->items = $items; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['items']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_List'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->cond = $cond; 21 | $this->arms = $arms; 22 | } 23 | 24 | public function getSubNodeNames() : array { 25 | return ['cond', 'arms']; 26 | } 27 | 28 | public function getType() : string { 29 | return 'Expr_Match'; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php: -------------------------------------------------------------------------------- 1 | Arguments */ 17 | public $args; 18 | 19 | /** 20 | * Constructs a function call node. 21 | * 22 | * @param Expr $var Variable holding object 23 | * @param string|Identifier|Expr $name Method name 24 | * @param array $args Arguments 25 | * @param array $attributes Additional attributes 26 | */ 27 | public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { 28 | $this->attributes = $attributes; 29 | $this->var = $var; 30 | $this->name = \is_string($name) ? new Identifier($name) : $name; 31 | $this->args = $args; 32 | } 33 | 34 | public function getSubNodeNames() : array { 35 | return ['var', 'name', 'args']; 36 | } 37 | 38 | public function getType() : string { 39 | return 'Expr_MethodCall'; 40 | } 41 | 42 | public function getRawArgs(): array { 43 | return $this->args; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php: -------------------------------------------------------------------------------- 1 | Arguments */ 15 | public $args; 16 | 17 | /** 18 | * Constructs a function call node. 19 | * 20 | * @param Node\Name|Expr|Node\Stmt\Class_ $class Class name (or class node for anonymous classes) 21 | * @param array $args Arguments 22 | * @param array $attributes Additional attributes 23 | */ 24 | public function __construct($class, array $args = [], array $attributes = []) { 25 | $this->attributes = $attributes; 26 | $this->class = $class; 27 | $this->args = $args; 28 | } 29 | 30 | public function getSubNodeNames() : array { 31 | return ['class', 'args']; 32 | } 33 | 34 | public function getType() : string { 35 | return 'Expr_New'; 36 | } 37 | 38 | public function getRawArgs(): array { 39 | return $this->args; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php: -------------------------------------------------------------------------------- 1 | Arguments */ 17 | public $args; 18 | 19 | /** 20 | * Constructs a nullsafe method call node. 21 | * 22 | * @param Expr $var Variable holding object 23 | * @param string|Identifier|Expr $name Method name 24 | * @param array $args Arguments 25 | * @param array $attributes Additional attributes 26 | */ 27 | public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { 28 | $this->attributes = $attributes; 29 | $this->var = $var; 30 | $this->name = \is_string($name) ? new Identifier($name) : $name; 31 | $this->args = $args; 32 | } 33 | 34 | public function getSubNodeNames() : array { 35 | return ['var', 'name', 'args']; 36 | } 37 | 38 | public function getType() : string { 39 | return 'Expr_NullsafeMethodCall'; 40 | } 41 | 42 | public function getRawArgs(): array { 43 | return $this->args; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 24 | $this->var = $var; 25 | $this->name = \is_string($name) ? new Identifier($name) : $name; 26 | } 27 | 28 | public function getSubNodeNames() : array { 29 | return ['var', 'name']; 30 | } 31 | 32 | public function getType() : string { 33 | return 'Expr_NullsafePropertyFetch'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->var = $var; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['var']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_PostDec'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->var = $var; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['var']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_PostInc'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->var = $var; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['var']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_PreDec'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->var = $var; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['var']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_PreInc'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->expr = $expr; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['expr']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_Print'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 24 | $this->var = $var; 25 | $this->name = \is_string($name) ? new Identifier($name) : $name; 26 | } 27 | 28 | public function getSubNodeNames() : array { 29 | return ['var', 'name']; 30 | } 31 | 32 | public function getType() : string { 33 | return 'Expr_PropertyFetch'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->parts = $parts; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['parts']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_ShellExec'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php: -------------------------------------------------------------------------------- 1 | Arguments */ 18 | public $args; 19 | 20 | /** 21 | * Constructs a static method call node. 22 | * 23 | * @param Node\Name|Expr $class Class name 24 | * @param string|Identifier|Expr $name Method name 25 | * @param array $args Arguments 26 | * @param array $attributes Additional attributes 27 | */ 28 | public function __construct($class, $name, array $args = [], array $attributes = []) { 29 | $this->attributes = $attributes; 30 | $this->class = $class; 31 | $this->name = \is_string($name) ? new Identifier($name) : $name; 32 | $this->args = $args; 33 | } 34 | 35 | public function getSubNodeNames() : array { 36 | return ['class', 'name', 'args']; 37 | } 38 | 39 | public function getType() : string { 40 | return 'Expr_StaticCall'; 41 | } 42 | 43 | public function getRawArgs(): array { 44 | return $this->args; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 25 | $this->class = $class; 26 | $this->name = \is_string($name) ? new VarLikeIdentifier($name) : $name; 27 | } 28 | 29 | public function getSubNodeNames() : array { 30 | return ['class', 'name']; 31 | } 32 | 33 | public function getType() : string { 34 | return 'Expr_StaticPropertyFetch'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 26 | $this->cond = $cond; 27 | $this->if = $if; 28 | $this->else = $else; 29 | } 30 | 31 | public function getSubNodeNames() : array { 32 | return ['cond', 'if', 'else']; 33 | } 34 | 35 | public function getType() : string { 36 | return 'Expr_Ternary'; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->expr = $expr; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['expr']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_Throw'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->expr = $expr; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['expr']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_UnaryMinus'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->expr = $expr; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['expr']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_UnaryPlus'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->name = $name; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['name']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_Variable'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->expr = $expr; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['expr']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Expr_YieldFrom'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->key = $key; 24 | $this->value = $value; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['key', 'value']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Expr_Yield'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php: -------------------------------------------------------------------------------- 1 | true, 17 | 'parent' => true, 18 | 'static' => true, 19 | ]; 20 | 21 | /** 22 | * Constructs an identifier node. 23 | * 24 | * @param string $name Identifier as string 25 | * @param array $attributes Additional attributes 26 | */ 27 | public function __construct(string $name, array $attributes = []) { 28 | $this->attributes = $attributes; 29 | $this->name = $name; 30 | } 31 | 32 | public function getSubNodeNames() : array { 33 | return ['name']; 34 | } 35 | 36 | /** 37 | * Get identifier as string. 38 | * 39 | * @return string Identifier as string. 40 | */ 41 | public function toString() : string { 42 | return $this->name; 43 | } 44 | 45 | /** 46 | * Get lowercased identifier as string. 47 | * 48 | * @return string Lowercased identifier as string 49 | */ 50 | public function toLowerString() : string { 51 | return strtolower($this->name); 52 | } 53 | 54 | /** 55 | * Checks whether the identifier is a special class name (self, parent or static). 56 | * 57 | * @return bool Whether identifier is a special class name 58 | */ 59 | public function isSpecialClassName() : bool { 60 | return isset(self::$specialClassNames[strtolower($this->name)]); 61 | } 62 | 63 | /** 64 | * Get identifier as string. 65 | * 66 | * @return string Identifier as string 67 | */ 68 | public function __toString() : string { 69 | return $this->name; 70 | } 71 | 72 | public function getType() : string { 73 | return 'Identifier'; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->types = $types; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['types']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'IntersectionType'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php: -------------------------------------------------------------------------------- 1 | conds = $conds; 20 | $this->body = $body; 21 | $this->attributes = $attributes; 22 | } 23 | 24 | public function getSubNodeNames() : array { 25 | return ['conds', 'body']; 26 | } 27 | 28 | public function getType() : string { 29 | return 'MatchArm'; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php: -------------------------------------------------------------------------------- 1 | toString(); 45 | } 46 | 47 | public function getType() : string { 48 | return 'Name_FullyQualified'; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php: -------------------------------------------------------------------------------- 1 | toString(); 45 | } 46 | 47 | public function getType() : string { 48 | return 'Name_Relative'; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 18 | $this->type = \is_string($type) ? new Identifier($type) : $type; 19 | } 20 | 21 | public function getSubNodeNames() : array { 22 | return ['type']; 23 | } 24 | 25 | public function getType() : string { 26 | return 'NullableType'; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->value = $value; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['value']; 25 | } 26 | 27 | /** 28 | * @param mixed[] $attributes 29 | */ 30 | public static function fromString(string $str, array $attributes = []): DNumber 31 | { 32 | $attributes['rawValue'] = $str; 33 | $float = self::parse($str); 34 | 35 | return new DNumber($float, $attributes); 36 | } 37 | 38 | /** 39 | * @internal 40 | * 41 | * Parses a DNUMBER token like PHP would. 42 | * 43 | * @param string $str A string number 44 | * 45 | * @return float The parsed number 46 | */ 47 | public static function parse(string $str) : float { 48 | $str = str_replace('_', '', $str); 49 | 50 | // Check whether this is one of the special integer notations. 51 | if ('0' === $str[0]) { 52 | // hex 53 | if ('x' === $str[1] || 'X' === $str[1]) { 54 | return hexdec($str); 55 | } 56 | 57 | // bin 58 | if ('b' === $str[1] || 'B' === $str[1]) { 59 | return bindec($str); 60 | } 61 | 62 | // oct, but only if the string does not contain any of '.eE'. 63 | if (false === strpbrk($str, '.eE')) { 64 | // substr($str, 0, strcspn($str, '89')) cuts the string at the first invalid digit 65 | // (8 or 9) so that only the digits before that are used. 66 | return octdec(substr($str, 0, strcspn($str, '89'))); 67 | } 68 | } 69 | 70 | // dec 71 | return (float) $str; 72 | } 73 | 74 | public function getType() : string { 75 | return 'Scalar_DNumber'; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 21 | $this->parts = $parts; 22 | } 23 | 24 | public function getSubNodeNames() : array { 25 | return ['parts']; 26 | } 27 | 28 | public function getType() : string { 29 | return 'Scalar_Encapsed'; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->value = $value; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['value']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Scalar_EncapsedStringPart'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 16 | } 17 | 18 | public function getSubNodeNames() : array { 19 | return []; 20 | } 21 | 22 | /** 23 | * Get name of magic constant. 24 | * 25 | * @return string Name of magic constant 26 | */ 27 | abstract public function getName() : string; 28 | } 29 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->num = $num; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['num']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Stmt_Break'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->cond = $cond; 24 | $this->stmts = $stmts; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['cond', 'stmts']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Stmt_Case'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 29 | $this->types = $types; 30 | $this->var = $var; 31 | $this->stmts = $stmts; 32 | } 33 | 34 | public function getSubNodeNames() : array { 35 | return ['types', 'var', 'stmts']; 36 | } 37 | 38 | public function getType() : string { 39 | return 'Stmt_Catch'; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->consts = $consts; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['consts']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Stmt_Const'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->num = $num; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['num']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Stmt_Continue'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php: -------------------------------------------------------------------------------- 1 | value pair node. 16 | * 17 | * @param string|Node\Identifier $key Key 18 | * @param Node\Expr $value Value 19 | * @param array $attributes Additional attributes 20 | */ 21 | public function __construct($key, Node\Expr $value, array $attributes = []) { 22 | $this->attributes = $attributes; 23 | $this->key = \is_string($key) ? new Node\Identifier($key) : $key; 24 | $this->value = $value; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['key', 'value']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Stmt_DeclareDeclare'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->declares = $declares; 24 | $this->stmts = $stmts; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['declares', 'stmts']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Stmt_Declare'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->cond = $cond; 24 | $this->stmts = $stmts; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['stmts', 'cond']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Stmt_Do'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->exprs = $exprs; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['exprs']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Stmt_Echo'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->cond = $cond; 24 | $this->stmts = $stmts; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['cond', 'stmts']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Stmt_ElseIf'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->stmts = $stmts; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['stmts']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Stmt_Else'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php: -------------------------------------------------------------------------------- 1 | name = \is_string($name) ? new Node\Identifier($name) : $name; 26 | $this->expr = $expr; 27 | $this->attrGroups = $attrGroups; 28 | } 29 | 30 | public function getSubNodeNames() : array { 31 | return ['attrGroups', 'name', 'expr']; 32 | } 33 | 34 | public function getType() : string { 35 | return 'Stmt_EnumCase'; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php: -------------------------------------------------------------------------------- 1 | null : Scalar type 18 | * 'implements' => array() : Names of implemented interfaces 19 | * 'stmts' => array() : Statements 20 | * 'attrGroups' => array() : PHP attribute groups 21 | * @param array $attributes Additional attributes 22 | */ 23 | public function __construct($name, array $subNodes = [], array $attributes = []) { 24 | $this->name = \is_string($name) ? new Node\Identifier($name) : $name; 25 | $this->scalarType = $subNodes['scalarType'] ?? null; 26 | $this->implements = $subNodes['implements'] ?? []; 27 | $this->stmts = $subNodes['stmts'] ?? []; 28 | $this->attrGroups = $subNodes['attrGroups'] ?? []; 29 | 30 | parent::__construct($attributes); 31 | } 32 | 33 | public function getSubNodeNames() : array { 34 | return ['attrGroups', 'name', 'scalarType', 'implements', 'stmts']; 35 | } 36 | 37 | public function getType() : string { 38 | return 'Stmt_Enum'; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->expr = $expr; 24 | } 25 | 26 | public function getSubNodeNames() : array { 27 | return ['expr']; 28 | } 29 | 30 | public function getType() : string { 31 | return 'Stmt_Expression'; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->stmts = $stmts; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['stmts']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Stmt_Finally'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php: -------------------------------------------------------------------------------- 1 | array(): Init expressions 23 | * 'cond' => array(): Loop conditions 24 | * 'loop' => array(): Loop expressions 25 | * 'stmts' => array(): Statements 26 | * @param array $attributes Additional attributes 27 | */ 28 | public function __construct(array $subNodes = [], array $attributes = []) { 29 | $this->attributes = $attributes; 30 | $this->init = $subNodes['init'] ?? []; 31 | $this->cond = $subNodes['cond'] ?? []; 32 | $this->loop = $subNodes['loop'] ?? []; 33 | $this->stmts = $subNodes['stmts'] ?? []; 34 | } 35 | 36 | public function getSubNodeNames() : array { 37 | return ['init', 'cond', 'loop', 'stmts']; 38 | } 39 | 40 | public function getType() : string { 41 | return 'Stmt_For'; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php: -------------------------------------------------------------------------------- 1 | null : Variable to assign key to 27 | * 'byRef' => false : Whether to assign value by reference 28 | * 'stmts' => array(): Statements 29 | * @param array $attributes Additional attributes 30 | */ 31 | public function __construct(Node\Expr $expr, Node\Expr $valueVar, array $subNodes = [], array $attributes = []) { 32 | $this->attributes = $attributes; 33 | $this->expr = $expr; 34 | $this->keyVar = $subNodes['keyVar'] ?? null; 35 | $this->byRef = $subNodes['byRef'] ?? false; 36 | $this->valueVar = $valueVar; 37 | $this->stmts = $subNodes['stmts'] ?? []; 38 | } 39 | 40 | public function getSubNodeNames() : array { 41 | return ['expr', 'keyVar', 'byRef', 'valueVar', 'stmts']; 42 | } 43 | 44 | public function getType() : string { 45 | return 'Stmt_Foreach'; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->vars = $vars; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['vars']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Stmt_Global'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 21 | $this->name = \is_string($name) ? new Identifier($name) : $name; 22 | } 23 | 24 | public function getSubNodeNames() : array { 25 | return ['name']; 26 | } 27 | 28 | public function getType() : string { 29 | return 'Stmt_Goto'; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 27 | $this->type = $type; 28 | $this->prefix = $prefix; 29 | $this->uses = $uses; 30 | } 31 | 32 | public function getSubNodeNames() : array { 33 | return ['type', 'prefix', 'uses']; 34 | } 35 | 36 | public function getType() : string { 37 | return 'Stmt_GroupUse'; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->remaining = $remaining; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['remaining']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Stmt_HaltCompiler'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php: -------------------------------------------------------------------------------- 1 | array(): Statements 24 | * 'elseifs' => array(): Elseif clauses 25 | * 'else' => null : Else clause 26 | * @param array $attributes Additional attributes 27 | */ 28 | public function __construct(Node\Expr $cond, array $subNodes = [], array $attributes = []) { 29 | $this->attributes = $attributes; 30 | $this->cond = $cond; 31 | $this->stmts = $subNodes['stmts'] ?? []; 32 | $this->elseifs = $subNodes['elseifs'] ?? []; 33 | $this->else = $subNodes['else'] ?? null; 34 | } 35 | 36 | public function getSubNodeNames() : array { 37 | return ['cond', 'stmts', 'elseifs', 'else']; 38 | } 39 | 40 | public function getType() : string { 41 | return 'Stmt_If'; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->value = $value; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['value']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Stmt_InlineHTML'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php: -------------------------------------------------------------------------------- 1 | array(): Name of extended interfaces 18 | * 'stmts' => array(): Statements 19 | * 'attrGroups' => array(): PHP attribute groups 20 | * @param array $attributes Additional attributes 21 | */ 22 | public function __construct($name, array $subNodes = [], array $attributes = []) { 23 | $this->attributes = $attributes; 24 | $this->name = \is_string($name) ? new Node\Identifier($name) : $name; 25 | $this->extends = $subNodes['extends'] ?? []; 26 | $this->stmts = $subNodes['stmts'] ?? []; 27 | $this->attrGroups = $subNodes['attrGroups'] ?? []; 28 | } 29 | 30 | public function getSubNodeNames() : array { 31 | return ['attrGroups', 'name', 'extends', 'stmts']; 32 | } 33 | 34 | public function getType() : string { 35 | return 'Stmt_Interface'; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 21 | $this->name = \is_string($name) ? new Identifier($name) : $name; 22 | } 23 | 24 | public function getSubNodeNames() : array { 25 | return ['name']; 26 | } 27 | 28 | public function getType() : string { 29 | return 'Stmt_Label'; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 27 | $this->name = $name; 28 | $this->stmts = $stmts; 29 | } 30 | 31 | public function getSubNodeNames() : array { 32 | return ['name', 'stmts']; 33 | } 34 | 35 | public function getType() : string { 36 | return 'Stmt_Namespace'; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->name = \is_string($name) ? new Node\VarLikeIdentifier($name) : $name; 24 | $this->default = $default; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['name', 'default']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Stmt_PropertyProperty'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->expr = $expr; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['expr']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Stmt_Return'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 26 | $this->var = $var; 27 | $this->default = $default; 28 | } 29 | 30 | public function getSubNodeNames() : array { 31 | return ['var', 'default']; 32 | } 33 | 34 | public function getType() : string { 35 | return 'Stmt_StaticVar'; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->vars = $vars; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['vars']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Stmt_Static'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->cond = $cond; 24 | $this->cases = $cases; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['cond', 'cases']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Stmt_Switch'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->expr = $expr; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['expr']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Stmt_Throw'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->traits = $traits; 24 | $this->adaptations = $adaptations; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['traits', 'adaptations']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Stmt_TraitUse'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 25 | $this->trait = $trait; 26 | $this->method = \is_string($method) ? new Node\Identifier($method) : $method; 27 | $this->newModifier = $newModifier; 28 | $this->newName = \is_string($newName) ? new Node\Identifier($newName) : $newName; 29 | } 30 | 31 | public function getSubNodeNames() : array { 32 | return ['trait', 'method', 'newModifier', 'newName']; 33 | } 34 | 35 | public function getType() : string { 36 | return 'Stmt_TraitUseAdaptation_Alias'; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 22 | $this->trait = $trait; 23 | $this->method = \is_string($method) ? new Node\Identifier($method) : $method; 24 | $this->insteadof = $insteadof; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['trait', 'method', 'insteadof']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Stmt_TraitUseAdaptation_Precedence'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php: -------------------------------------------------------------------------------- 1 | array(): Statements 15 | * 'attrGroups' => array(): PHP attribute groups 16 | * @param array $attributes Additional attributes 17 | */ 18 | public function __construct($name, array $subNodes = [], array $attributes = []) { 19 | $this->attributes = $attributes; 20 | $this->name = \is_string($name) ? new Node\Identifier($name) : $name; 21 | $this->stmts = $subNodes['stmts'] ?? []; 22 | $this->attrGroups = $subNodes['attrGroups'] ?? []; 23 | } 24 | 25 | public function getSubNodeNames() : array { 26 | return ['attrGroups', 'name', 'stmts']; 27 | } 28 | 29 | public function getType() : string { 30 | return 'Stmt_Trait'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 26 | $this->stmts = $stmts; 27 | $this->catches = $catches; 28 | $this->finally = $finally; 29 | } 30 | 31 | public function getSubNodeNames() : array { 32 | return ['stmts', 'catches', 'finally']; 33 | } 34 | 35 | public function getType() : string { 36 | return 'Stmt_TryCatch'; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 20 | $this->vars = $vars; 21 | } 22 | 23 | public function getSubNodeNames() : array { 24 | return ['vars']; 25 | } 26 | 27 | public function getType() : string { 28 | return 'Stmt_Unset'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 27 | $this->type = $type; 28 | $this->name = $name; 29 | $this->alias = \is_string($alias) ? new Identifier($alias) : $alias; 30 | } 31 | 32 | public function getSubNodeNames() : array { 33 | return ['type', 'name', 'alias']; 34 | } 35 | 36 | /** 37 | * Get alias. If not explicitly given this is the last component of the used name. 38 | * 39 | * @return Identifier 40 | */ 41 | public function getAlias() : Identifier { 42 | if (null !== $this->alias) { 43 | return $this->alias; 44 | } 45 | 46 | return new Identifier($this->name->getLast()); 47 | } 48 | 49 | public function getType() : string { 50 | return 'Stmt_UseUse'; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 36 | $this->type = $type; 37 | $this->uses = $uses; 38 | } 39 | 40 | public function getSubNodeNames() : array { 41 | return ['type', 'uses']; 42 | } 43 | 44 | public function getType() : string { 45 | return 'Stmt_Use'; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 23 | $this->cond = $cond; 24 | $this->stmts = $stmts; 25 | } 26 | 27 | public function getSubNodeNames() : array { 28 | return ['cond', 'stmts']; 29 | } 30 | 31 | public function getType() : string { 32 | return 'Stmt_While'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 18 | $this->types = $types; 19 | } 20 | 21 | public function getSubNodeNames() : array { 22 | return ['types']; 23 | } 24 | 25 | public function getType() : string { 26 | return 'UnionType'; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php: -------------------------------------------------------------------------------- 1 | attributes = $attributes; 18 | } 19 | 20 | public function getType(): string { 21 | return 'VariadicPlaceholder'; 22 | } 23 | 24 | public function getSubNodeNames(): array { 25 | return []; 26 | } 27 | } -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php: -------------------------------------------------------------------------------- 1 | $node stays as-is 26 | * * NodeTraverser::DONT_TRAVERSE_CHILDREN 27 | * => Children of $node are not traversed. $node stays as-is 28 | * * NodeTraverser::STOP_TRAVERSAL 29 | * => Traversal is aborted. $node stays as-is 30 | * * otherwise 31 | * => $node is set to the return value 32 | * 33 | * @param Node $node Node 34 | * 35 | * @return null|int|Node Replacement node (or special return value) 36 | */ 37 | public function enterNode(Node $node); 38 | 39 | /** 40 | * Called when leaving a node. 41 | * 42 | * Return value semantics: 43 | * * null 44 | * => $node stays as-is 45 | * * NodeTraverser::REMOVE_NODE 46 | * => $node is removed from the parent array 47 | * * NodeTraverser::STOP_TRAVERSAL 48 | * => Traversal is aborted. $node stays as-is 49 | * * array (of Nodes) 50 | * => The return value is merged into the parent array (at the position of the $node) 51 | * * otherwise 52 | * => $node is set to the return value 53 | * 54 | * @param Node $node Node 55 | * 56 | * @return null|int|Node|Node[] Replacement node (or special return value) 57 | */ 58 | public function leaveNode(Node $node); 59 | 60 | /** 61 | * Called once after traversal. 62 | * 63 | * Return value semantics: 64 | * * null: $nodes stays as-is 65 | * * otherwise: $nodes is set to the return value 66 | * 67 | * @param Node[] $nodes Array of nodes 68 | * 69 | * @return null|Node[] Array of nodes 70 | */ 71 | public function afterTraverse(array $nodes); 72 | } 73 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php: -------------------------------------------------------------------------------- 1 | setAttribute('origNode', $origNode); 18 | return $node; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php: -------------------------------------------------------------------------------- 1 | filterCallback = $filterCallback; 21 | } 22 | 23 | /** 24 | * Get found nodes satisfying the filter callback. 25 | * 26 | * Nodes are returned in pre-order. 27 | * 28 | * @return Node[] Found nodes 29 | */ 30 | public function getFoundNodes() : array { 31 | return $this->foundNodes; 32 | } 33 | 34 | public function beforeTraverse(array $nodes) { 35 | $this->foundNodes = []; 36 | 37 | return null; 38 | } 39 | 40 | public function enterNode(Node $node) { 41 | $filterCallback = $this->filterCallback; 42 | if ($filterCallback($node)) { 43 | $this->foundNodes[] = $node; 44 | } 45 | 46 | return null; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php: -------------------------------------------------------------------------------- 1 | filterCallback = $filterCallback; 22 | } 23 | 24 | /** 25 | * Get found node satisfying the filter callback. 26 | * 27 | * Returns null if no node satisfies the filter callback. 28 | * 29 | * @return null|Node Found node (or null if not found) 30 | */ 31 | public function getFoundNode() { 32 | return $this->foundNode; 33 | } 34 | 35 | public function beforeTraverse(array $nodes) { 36 | $this->foundNode = null; 37 | 38 | return null; 39 | } 40 | 41 | public function enterNode(Node $node) { 42 | $filterCallback = $this->filterCallback; 43 | if ($filterCallback($node)) { 44 | $this->foundNode = $node; 45 | return NodeTraverser::STOP_TRAVERSAL; 46 | } 47 | 48 | return null; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php: -------------------------------------------------------------------------------- 1 | $node->getAttribute('parent'), the previous 14 | * node can be accessed through $node->getAttribute('previous'), 15 | * and the next node can be accessed through $node->getAttribute('next'). 16 | */ 17 | final class NodeConnectingVisitor extends NodeVisitorAbstract 18 | { 19 | /** 20 | * @var Node[] 21 | */ 22 | private $stack = []; 23 | 24 | /** 25 | * @var ?Node 26 | */ 27 | private $previous; 28 | 29 | public function beforeTraverse(array $nodes) { 30 | $this->stack = []; 31 | $this->previous = null; 32 | } 33 | 34 | public function enterNode(Node $node) { 35 | if (!empty($this->stack)) { 36 | $node->setAttribute('parent', $this->stack[count($this->stack) - 1]); 37 | } 38 | 39 | if ($this->previous !== null && $this->previous->getAttribute('parent') === $node->getAttribute('parent')) { 40 | $node->setAttribute('previous', $this->previous); 41 | $this->previous->setAttribute('next', $node); 42 | } 43 | 44 | $this->stack[] = $node; 45 | } 46 | 47 | public function leaveNode(Node $node) { 48 | $this->previous = $node; 49 | 50 | array_pop($this->stack); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php: -------------------------------------------------------------------------------- 1 | $node->getAttribute('parent'). 15 | */ 16 | final class ParentConnectingVisitor extends NodeVisitorAbstract 17 | { 18 | /** 19 | * @var Node[] 20 | */ 21 | private $stack = []; 22 | 23 | public function beforeTraverse(array $nodes) 24 | { 25 | $this->stack = []; 26 | } 27 | 28 | public function enterNode(Node $node) 29 | { 30 | if (!empty($this->stack)) { 31 | $node->setAttribute('parent', $this->stack[count($this->stack) - 1]); 32 | } 33 | 34 | $this->stack[] = $node; 35 | } 36 | 37 | public function leaveNode(Node $node) 38 | { 39 | array_pop($this->stack); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php: -------------------------------------------------------------------------------- 1 | parsers = $parsers; 25 | } 26 | 27 | public function parse(string $code, ?ErrorHandler $errorHandler = null) { 28 | if (null === $errorHandler) { 29 | $errorHandler = new ErrorHandler\Throwing; 30 | } 31 | 32 | list($firstStmts, $firstError) = $this->tryParse($this->parsers[0], $errorHandler, $code); 33 | if ($firstError === null) { 34 | return $firstStmts; 35 | } 36 | 37 | for ($i = 1, $c = count($this->parsers); $i < $c; ++$i) { 38 | list($stmts, $error) = $this->tryParse($this->parsers[$i], $errorHandler, $code); 39 | if ($error === null) { 40 | return $stmts; 41 | } 42 | } 43 | 44 | throw $firstError; 45 | } 46 | 47 | private function tryParse(Parser $parser, ErrorHandler $errorHandler, $code) { 48 | $stmts = null; 49 | $error = null; 50 | try { 51 | $stmts = $parser->parse($code, $errorHandler); 52 | } catch (Error $error) {} 53 | return [$stmts, $error]; 54 | } 55 | } 56 | --------------------------------------------------------------------------------