This commit is contained in:
Torsten 2018-08-07 10:42:11 +02:00
parent 98419bd18d
commit 8a69e45efa
4919 changed files with 28311 additions and 224136 deletions

0
pfosten/vendor/nikic/php-parser/.gitignore vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/.travis.yml vendored Executable file → Normal file
View file

64
pfosten/vendor/nikic/php-parser/CHANGELOG.md vendored Executable file → Normal file
View file

@ -1,8 +1,70 @@
Version 3.1.0-dev
Version 3.1.6-dev
-----------------
Nothing yet.
Version 3.1.5 (2018-02-28)
--------------------------
### Fixed
* Fixed duplicate comment assignment in switch statements. (#469)
* Improve compatibility with PHP-Scoper. (#477)
Version 3.1.4 (2018-01-25)
--------------------------
### Fixed
* Fixed pretty printing of `-(-$x)` and `+(+$x)`. (#459)
Version 3.1.3 (2017-12-26)
--------------------------
### Fixed
* Improve compatibility with php-scoper, by supporting prefixed namespaces in
`NodeAbstract::getType()`.
Version 3.1.2 (2017-11-04)
--------------------------
### Fixed
* Comments on empty blocks are now preserved on a `Stmt\Nop` node. (#382)
### Added
* Added `kind` attribute for `Stmt\Namespace_` node, which is one of `KIND_SEMICOLON` or
`KIND_BRACED`. (#417)
* Added `setDocComment()` method to namespace builder. (#437)
Version 3.1.1 (2017-09-02)
--------------------------
### Fixed
* Fixed syntax error on comment after brace-style namespace declaration. (#412)
* Added support for TraitUse statements in trait builder. (#413)
Version 3.1.0 (2017-07-28)
--------------------------
### Added
* [PHP 7.2] Added support for trailing comma in group use statements.
* [PHP 7.2] Added support for `object` type. This means `object` types will now be represented as a
builtin type (a simple `"object"` string), rather than a class `Name`.
### Fixed
* Floating-point numbers are now printed correctly if the LC_NUMERIC locale uses a comma as decimal
separator.
### Changed
* `Name::$parts` is no longer deprecated.
Version 3.0.6 (2017-06-28)
--------------------------

4
pfosten/vendor/nikic/php-parser/LICENSE vendored Executable file → Normal file
View file

@ -1,4 +1,4 @@
Copyright (c) 2011 by Nikita Popov.
Copyright (c) 2011-2018 by Nikita Popov.
Some rights reserved.
@ -28,4 +28,4 @@ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0
pfosten/vendor/nikic/php-parser/README.md vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/UPGRADE-1.0.md vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/UPGRADE-2.0.md vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/UPGRADE-3.0.md vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/composer.json vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/doc/0_Introduction.markdown vendored Executable file → Normal file
View file

View file

View file

0
pfosten/vendor/nikic/php-parser/doc/4_Code_generation.markdown vendored Executable file → Normal file
View file

View file

0
pfosten/vendor/nikic/php-parser/doc/component/Lexer.markdown vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/grammar/README.md vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/grammar/parser.template vendored Executable file → Normal file
View file

26
pfosten/vendor/nikic/php-parser/grammar/php5.y vendored Executable file → Normal file
View file

@ -56,11 +56,17 @@ top_statement:
| T_HALT_COMPILER
{ $$ = Stmt\HaltCompiler[$this->lexer->handleHaltCompiler()]; }
| T_NAMESPACE namespace_name ';'
{ $$ = Stmt\Namespace_[$2, null]; $this->checkNamespace($$); }
{ $$ = Stmt\Namespace_[$2, null];
$$->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON);
$this->checkNamespace($$); }
| T_NAMESPACE namespace_name '{' top_statement_list '}'
{ $$ = Stmt\Namespace_[$2, $4]; $this->checkNamespace($$); }
{ $$ = Stmt\Namespace_[$2, $4];
$$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED);
$this->checkNamespace($$); }
| T_NAMESPACE '{' top_statement_list '}'
{ $$ = Stmt\Namespace_[null, $3]; $this->checkNamespace($$); }
{ $$ = Stmt\Namespace_[null, $3];
$$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED);
$this->checkNamespace($$); }
| T_USE use_declarations ';' { $$ = Stmt\Use_[$2, Stmt\Use_::TYPE_NORMAL]; }
| T_USE use_type use_declarations ';' { $$ = Stmt\Use_[$3, $2]; }
| group_use_declaration ';' { $$ = $1; }
@ -155,7 +161,15 @@ inner_statement:
;
non_empty_statement:
'{' inner_statement_list '}' { $$ = $2; prependLeadingComments($$); }
'{' inner_statement_list '}'
{
if ($2) {
$$ = $2; prependLeadingComments($$);
} else {
makeNop($$, $this->startAttributeStack[#1]);
if (null === $$) { $$ = array(); }
}
}
| T_IF parentheses_expr statement elseif_list else_single
{ $$ = Stmt\If_[$2, ['stmts' => toArray($3), 'elseifs' => $4, 'else' => $5]]; }
| T_IF parentheses_expr ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';'
@ -309,8 +323,8 @@ case_list:
;
case:
T_CASE expr case_separator inner_statement_list { $$ = Stmt\Case_[$2, $4]; }
| T_DEFAULT case_separator inner_statement_list { $$ = Stmt\Case_[null, $3]; }
T_CASE expr case_separator inner_statement_list_ex { $$ = Stmt\Case_[$2, $4]; }
| T_DEFAULT case_separator inner_statement_list_ex { $$ = Stmt\Case_[null, $3]; }
;
case_separator:

34
pfosten/vendor/nikic/php-parser/grammar/php7.y vendored Executable file → Normal file
View file

@ -59,6 +59,10 @@ no_comma:
| ',' { $this->emitError(new Error('A trailing comma is not allowed here', attributes())); }
;
optional_comma:
/* empty */
| ','
top_statement:
statement { $$ = $1; }
| function_declaration_statement { $$ = $1; }
@ -66,11 +70,17 @@ top_statement:
| T_HALT_COMPILER
{ $$ = Stmt\HaltCompiler[$this->lexer->handleHaltCompiler()]; }
| T_NAMESPACE namespace_name semi
{ $$ = Stmt\Namespace_[$2, null]; $this->checkNamespace($$); }
{ $$ = Stmt\Namespace_[$2, null];
$$->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON);
$this->checkNamespace($$); }
| T_NAMESPACE namespace_name '{' top_statement_list '}'
{ $$ = Stmt\Namespace_[$2, $4]; $this->checkNamespace($$); }
{ $$ = Stmt\Namespace_[$2, $4];
$$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED);
$this->checkNamespace($$); }
| T_NAMESPACE '{' top_statement_list '}'
{ $$ = Stmt\Namespace_[null, $3]; $this->checkNamespace($$); }
{ $$ = Stmt\Namespace_[null, $3];
$$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED);
$this->checkNamespace($$); }
| T_USE use_declarations semi { $$ = Stmt\Use_[$2, Stmt\Use_::TYPE_NORMAL]; }
| T_USE use_type use_declarations semi { $$ = Stmt\Use_[$3, $2]; }
| group_use_declaration semi { $$ = $1; }
@ -95,7 +105,7 @@ group_use_declaration:
;
unprefixed_use_declarations:
non_empty_unprefixed_use_declarations no_comma { $$ = $1; }
non_empty_unprefixed_use_declarations optional_comma { $$ = $1; }
;
non_empty_unprefixed_use_declarations:
@ -114,7 +124,7 @@ non_empty_use_declarations:
;
inline_use_declarations:
non_empty_inline_use_declarations no_comma { $$ = $1; }
non_empty_inline_use_declarations optional_comma { $$ = $1; }
;
non_empty_inline_use_declarations:
@ -187,7 +197,15 @@ inner_statement:
;
non_empty_statement:
'{' inner_statement_list '}' { $$ = $2; prependLeadingComments($$); }
'{' inner_statement_list '}'
{
if ($2) {
$$ = $2; prependLeadingComments($$);
} else {
makeNop($$, $this->startAttributeStack[#1]);
if (null === $$) { $$ = array(); }
}
}
| T_IF '(' expr ')' statement elseif_list else_single
{ $$ = Stmt\If_[$3, ['stmts' => toArray($5), 'elseifs' => $6, 'else' => $7]]; }
| T_IF '(' expr ')' ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';'
@ -353,8 +371,8 @@ case_list:
;
case:
T_CASE expr case_separator inner_statement_list { $$ = Stmt\Case_[$2, $4]; }
| T_DEFAULT case_separator inner_statement_list { $$ = Stmt\Case_[null, $3]; }
T_CASE expr case_separator inner_statement_list_ex { $$ = Stmt\Case_[$2, $4]; }
| T_DEFAULT case_separator inner_statement_list_ex { $$ = Stmt\Case_[null, $3]; }
;
case_separator:

2
pfosten/vendor/nikic/php-parser/grammar/rebuildParsers.php vendored Executable file → Normal file
View file

@ -205,7 +205,7 @@ function resolveMacros($code) {
assertArgs(1, $args, $name);
return '$attrs = $this->startAttributeStack[#1]; $stmts = ' . $args[0] . '; '
. 'if (!empty($attrs[\'comments\']) && isset($stmts[0])) {'
. 'if (!empty($attrs[\'comments\'])) {'
. '$stmts[0]->setAttribute(\'comments\', '
. 'array_merge($attrs[\'comments\'], $stmts[0]->getAttribute(\'comments\', []))); }';
}

0
pfosten/vendor/nikic/php-parser/grammar/tokens.template vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/grammar/tokens.y vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Autoloader.php vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Builder.php vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php vendored Executable file → Normal file
View file

View file

View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php vendored Executable file → Normal file
View file

View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php vendored Executable file → Normal file
View file

19
pfosten/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php vendored Executable file → Normal file
View file

@ -6,7 +6,7 @@ use PhpParser;
use PhpParser\Node;
use PhpParser\Node\Stmt;
class Namespace_ extends PhpParser\BuilderAbstract
class Namespace_ extends Declaration
{
private $name;
private $stmts = array();
@ -33,27 +33,12 @@ class Namespace_ extends PhpParser\BuilderAbstract
return $this;
}
/**
* Adds multiple statements.
*
* @param array $stmts The statements to add
*
* @return $this The builder instance (for fluid interface)
*/
public function addStmts(array $stmts) {
foreach ($stmts as $stmt) {
$this->addStmt($stmt);
}
return $this;
}
/**
* Returns the built node.
*
* @return Node The built node
*/
public function getNode() {
return new Stmt\Namespace_($this->name, $this->stmts);
return new Stmt\Namespace_($this->name, $this->stmts, $this->attributes);
}
}

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php vendored Executable file → Normal file
View file

5
pfosten/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php vendored Executable file → Normal file
View file

@ -8,6 +8,7 @@ use PhpParser\Node\Stmt;
class Trait_ extends Declaration
{
protected $name;
protected $uses = array();
protected $properties = array();
protected $methods = array();
@ -34,6 +35,8 @@ class Trait_ extends Declaration
$this->properties[] = $stmt;
} else if ($stmt instanceof Stmt\ClassMethod) {
$this->methods[] = $stmt;
} else if ($stmt instanceof Stmt\TraitUse) {
$this->uses[] = $stmt;
} else {
throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType()));
}
@ -49,7 +52,7 @@ class Trait_ extends Declaration
public function getNode() {
return new Stmt\Trait_(
$this->name, array(
'stmts' => array_merge($this->properties, $this->methods)
'stmts' => array_merge($this->uses, $this->properties, $this->methods)
), $this->attributes
);
}

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php vendored Executable file → Normal file
View file

2
pfosten/vendor/nikic/php-parser/lib/PhpParser/BuilderAbstract.php vendored Executable file → Normal file
View file

@ -80,7 +80,7 @@ abstract class BuilderAbstract implements Builder {
}
$builtinTypes = array(
'array', 'callable', 'string', 'int', 'float', 'bool', 'iterable', 'void'
'array', 'callable', 'string', 'int', 'float', 'bool', 'iterable', 'void', 'object'
);
$lowerType = strtolower($type);

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Comment.php vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Error.php vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php vendored Executable file → Normal file
View file

View file

View file

2
pfosten/vendor/nikic/php-parser/lib/PhpParser/Lexer.php vendored Executable file → Normal file
View file

@ -360,7 +360,7 @@ class Lexer
if ('T_HASHBANG' === $name) {
// HHVM uses a special token for #! hashbang lines
$tokenMap[$i] = Tokens::T_INLINE_HTML;
} else if (defined($name = 'PhpParser\Parser\Tokens::' . $name)) {
} else if (defined($name = Tokens::class . '::' . $name)) {
// Other tokens can be mapped directly
$tokenMap[$i] = constant($name);
}

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Node.php vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php vendored Executable file → Normal file
View file

View file

View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php vendored Executable file → Normal file
View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php vendored Executable file → Normal file
View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

0
pfosten/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php vendored Executable file → Normal file
View file

View file

View file

Some files were not shown because too many files have changed in this diff Show more