File Manager Lite
Dir:
/home/codewavebd/public_html/vendor/nikic/php-parser/lib/PhpParser
Upload
[..]
Builder/
Rename
Del
Builder.php (202 B)
Edit
Rename
Del
BuilderFactory.php (10.3 KB)
Edit
Rename
Del
BuilderHelpers.php (9.73 KB)
Edit
Rename
Del
Comment/
Rename
Del
Comment.php (6.75 KB)
Edit
Rename
Del
ConstExprEvaluationException.php (112 B)
Edit
Rename
Del
ConstExprEvaluator.php (9.33 KB)
Edit
Rename
Del
Error.php (4.84 KB)
Edit
Rename
Del
ErrorHandler/
Rename
Del
ErrorHandler.php (300 B)
Edit
Rename
Del
Internal/
Rename
Del
Lexer/
Rename
Del
Lexer.php (4.26 KB)
Edit
Rename
Del
Modifiers.php (2.71 KB)
Edit
Rename
Del
NameContext.php (9.82 KB)
Edit
Rename
Del
Node/
Rename
Del
Node.php (4.03 KB)
Edit
Rename
Del
NodeAbstract.php (5.24 KB)
Edit
Rename
Del
NodeDumper.php (10.24 KB)
Edit
Rename
Del
NodeFinder.php (2.55 KB)
Edit
Rename
Del
NodeTraverser.php (10.09 KB)
Edit
Rename
Del
NodeTraverserInterface.php (598 B)
Edit
Rename
Del
NodeVisitor/
Rename
Del
NodeVisitor.php (4.08 KB)
Edit
Rename
Del
NodeVisitorAbstract.php (447 B)
Edit
Rename
Del
Parser/
Rename
Del
Parser.php (765 B)
Edit
Rename
Del
ParserAbstract.php (51.59 KB)
Edit
Rename
Del
ParserFactory.php (1.41 KB)
Edit
Rename
Del
PhpVersion.php (4.73 KB)
Edit
Rename
Del
PrettyPrinter/
Rename
Del
PrettyPrinter.php (1.66 KB)
Edit
Rename
Del
PrettyPrinterAbstract.php (71.24 KB)
Edit
Rename
Del
Token.php (487 B)
Edit
Rename
Del
compatibility_tokens.php (2.46 KB)
Edit
Rename
Del
Edit: ParserFactory.php
<?php declare(strict_types=1); namespace PhpParser; use PhpParser\Parser\Php7; use PhpParser\Parser\Php8; class ParserFactory { /** * Create a parser targeting the given version on a best-effort basis. The parser will generally * accept code for the newest supported version, but will try to accommodate code that becomes * invalid in newer versions or changes in interpretation. */ public function createForVersion(PhpVersion $version): Parser { if ($version->isHostVersion()) { $lexer = new Lexer(); } else { $lexer = new Lexer\Emulative($version); } if ($version->id >= 80000) { return new Php8($lexer, $version); } return new Php7($lexer, $version); } /** * Create a parser targeting the newest version supported by this library. Code for older * versions will be accepted if there have been no relevant backwards-compatibility breaks in * PHP. */ public function createForNewestSupportedVersion(): Parser { return $this->createForVersion(PhpVersion::getNewestSupported()); } /** * Create a parser targeting the host PHP version, that is the PHP version we're currently * running on. This parser will not use any token emulation. */ public function createForHostVersion(): Parser { return $this->createForVersion(PhpVersion::getHostVersion()); } }
Simpan