update v 1.0.7.5

This commit is contained in:
Sujit Prasad
2016-06-13 20:41:55 +05:30
parent aa9786d829
commit 283d97e3ea
5078 changed files with 339851 additions and 175995 deletions

View File

@@ -16,7 +16,7 @@ class Break_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(Node\Expr $num = null, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->num = $num;
}

View File

@@ -19,7 +19,7 @@ class Case_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct($cond, array $stmts = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->cond = $cond;
$this->stmts = $stmts;
}

View File

@@ -22,7 +22,7 @@ class Catch_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(Node\Name $type, $var, array $stmts = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->type = $type;
$this->var = $var;
$this->stmts = $stmts;

View File

@@ -16,7 +16,7 @@ class ClassConst extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(array $consts, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->consts = $consts;
}

View File

@@ -34,7 +34,7 @@ class ClassMethod extends Node\Stmt implements FunctionLike
* @param array $attributes Additional attributes
*/
public function __construct($name, array $subNodes = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->type = isset($subNodes['type']) ? $subNodes['type'] : 0;
$this->byRef = isset($subNodes['byRef']) ? $subNodes['byRef'] : false;
$this->name = $name;

View File

@@ -41,7 +41,7 @@ class Class_ extends ClassLike
* @param array $attributes Additional attributes
*/
public function __construct($name, array $subNodes = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->type = isset($subNodes['type']) ? $subNodes['type'] : 0;
$this->name = $name;
$this->extends = isset($subNodes['extends']) ? $subNodes['extends'] : null;

View File

@@ -16,7 +16,7 @@ class Const_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(array $consts, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->consts = $consts;
}

View File

@@ -16,7 +16,7 @@ class Continue_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(Node\Expr $num = null, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->num = $num;
}

View File

@@ -19,7 +19,7 @@ class DeclareDeclare extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct($key, Node\Expr $value, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->key = $key;
$this->value = $value;
}

View File

@@ -14,11 +14,11 @@ class Declare_ extends Node\Stmt
* Constructs a declare node.
*
* @param DeclareDeclare[] $declares List of declares
* @param Node[] $stmts Statements
* @param Node[]|null $stmts Statements
* @param array $attributes Additional attributes
*/
public function __construct(array $declares, array $stmts, array $attributes = array()) {
parent::__construct(null, $attributes);
public function __construct(array $declares, array $stmts = null, array $attributes = array()) {
parent::__construct($attributes);
$this->declares = $declares;
$this->stmts = $stmts;
}

View File

@@ -19,7 +19,7 @@ class Do_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(Node\Expr $cond, array $stmts = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->cond = $cond;
$this->stmts = $stmts;
}

View File

@@ -16,7 +16,7 @@ class Echo_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(array $exprs, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->exprs = $exprs;
}

View File

@@ -19,7 +19,7 @@ class ElseIf_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(Node\Expr $cond, array $stmts = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->cond = $cond;
$this->stmts = $stmts;
}

View File

@@ -16,7 +16,7 @@ class Else_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(array $stmts = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->stmts = $stmts;
}

View File

@@ -26,7 +26,7 @@ class For_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(array $subNodes = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->init = isset($subNodes['init']) ? $subNodes['init'] : array();
$this->cond = isset($subNodes['cond']) ? $subNodes['cond'] : array();
$this->loop = isset($subNodes['loop']) ? $subNodes['loop'] : array();

View File

@@ -29,7 +29,7 @@ class Foreach_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(Node\Expr $expr, Node\Expr $valueVar, array $subNodes = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->expr = $expr;
$this->keyVar = isset($subNodes['keyVar']) ? $subNodes['keyVar'] : null;
$this->byRef = isset($subNodes['byRef']) ? $subNodes['byRef'] : false;

View File

@@ -30,7 +30,7 @@ class Function_ extends Node\Stmt implements FunctionLike
* @param array $attributes Additional attributes
*/
public function __construct($name, array $subNodes = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->byRef = isset($subNodes['byRef']) ? $subNodes['byRef'] : false;
$this->name = $name;
$this->params = isset($subNodes['params']) ? $subNodes['params'] : array();

View File

@@ -16,7 +16,7 @@ class Global_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(array $vars, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->vars = $vars;
}

View File

@@ -16,7 +16,7 @@ class Goto_ extends Stmt
* @param array $attributes Additional attributes
*/
public function __construct($name, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->name = $name;
}

View File

@@ -0,0 +1,35 @@
<?php
namespace PhpParser\Node\Stmt;
use PhpParser\Node\Stmt;
use PhpParser\Node\Name;
class GroupUse extends Stmt
{
/** @var int Type of group use */
public $type;
/** @var Name Prefix for uses */
public $prefix;
/** @var UseUse[] Uses */
public $uses;
/**
* Constructs a group use node.
*
* @param Name $prefix Prefix for uses
* @param UseUse[] $uses Uses
* @param int $type Type of group use
* @param array $attributes Additional attributes
*/
public function __construct(Name $prefix, array $uses, $type = Use_::TYPE_NORMAL, array $attributes = array()) {
parent::__construct($attributes);
$this->type = $type;
$this->prefix = $prefix;
$this->uses = $uses;
}
public function getSubNodeNames() {
return array('type', 'prefix', 'uses');
}
}

View File

@@ -16,7 +16,7 @@ class HaltCompiler extends Stmt
* @param array $attributes Additional attributes
*/
public function __construct($remaining, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->remaining = $remaining;
}

View File

@@ -26,7 +26,7 @@ class If_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(Node\Expr $cond, array $subNodes = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->cond = $cond;
$this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
$this->elseifs = isset($subNodes['elseifs']) ? $subNodes['elseifs'] : array();

View File

@@ -16,7 +16,7 @@ class InlineHTML extends Stmt
* @param array $attributes Additional attributes
*/
public function __construct($value, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->value = $value;
}

View File

@@ -26,7 +26,7 @@ class Interface_ extends ClassLike
* @param array $attributes Additional attributes
*/
public function __construct($name, array $subNodes = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->name = $name;
$this->extends = isset($subNodes['extends']) ? $subNodes['extends'] : array();
$this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();

View File

@@ -16,7 +16,7 @@ class Label extends Stmt
* @param array $attributes Additional attributes
*/
public function __construct($name, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->name = $name;
}

View File

@@ -26,7 +26,7 @@ class Namespace_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(Node\Name $name = null, $stmts = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->name = $name;
$this->stmts = $stmts;

View File

@@ -0,0 +1,13 @@
<?php
namespace PhpParser\Node\Stmt;
use PhpParser\Node;
/** Nop/empty statement (;). */
class Nop extends Node\Stmt
{
public function getSubNodeNames() {
return array();
}
}

View File

@@ -28,7 +28,7 @@ class Property extends Node\Stmt
throw new Error('Properties cannot be declared final');
}
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->type = $type;
$this->props = $props;
}

View File

@@ -19,7 +19,7 @@ class PropertyProperty extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct($name, Node\Expr $default = null, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->name = $name;
$this->default = $default;
}

View File

@@ -16,7 +16,7 @@ class Return_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(Node\Expr $expr = null, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->expr = $expr;
}

View File

@@ -19,7 +19,7 @@ class StaticVar extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct($name, Node\Expr $default = null, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->name = $name;
$this->default = $default;
}

View File

@@ -16,7 +16,7 @@ class Static_ extends Stmt
* @param array $attributes Additional attributes
*/
public function __construct(array $vars, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->vars = $vars;
}

View File

@@ -19,7 +19,7 @@ class Switch_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(Node\Expr $cond, array $cases, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->cond = $cond;
$this->cases = $cases;
}

View File

@@ -16,7 +16,7 @@ class Throw_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(Node\Expr $expr, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->expr = $expr;
}

View File

@@ -20,7 +20,7 @@ class TraitUse extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(array $traits, array $adaptations = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->traits = $traits;
$this->adaptations = $adaptations;
}

View File

@@ -21,7 +21,7 @@ class Alias extends Node\Stmt\TraitUseAdaptation
* @param array $attributes Additional attributes
*/
public function __construct($trait, $method, $newModifier, $newName, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->trait = $trait;
$this->method = $method;
$this->newModifier = $newModifier;

View File

@@ -18,7 +18,7 @@ class Precedence extends Node\Stmt\TraitUseAdaptation
* @param array $attributes Additional attributes
*/
public function __construct(Node\Name $trait, $method, array $insteadof, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->trait = $trait;
$this->method = $method;
$this->insteadof = $insteadof;

View File

@@ -14,7 +14,7 @@ class Trait_ extends ClassLike
* @param array $attributes Additional attributes
*/
public function __construct($name, array $stmts = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->name = $name;
$this->stmts = $stmts;
}

View File

@@ -27,7 +27,7 @@ class TryCatch extends Node\Stmt
throw new Error('Cannot use try without catch or finally');
}
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->stmts = $stmts;
$this->catches = $catches;
$this->finallyStmts = $finallyStmts;

View File

@@ -16,7 +16,7 @@ class Unset_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(array $vars, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->vars = $vars;
}

View File

@@ -7,6 +7,8 @@ use PhpParser\Error;
class UseUse extends Node\Stmt
{
/** @var int One of the Stmt\Use_::TYPE_* constants. Will only differ from TYPE_UNKNOWN for mixed group uses */
public $type;
/** @var Node\Name Namespace, class, function or constant to alias */
public $name;
/** @var string Alias */
@@ -17,9 +19,10 @@ class UseUse extends Node\Stmt
*
* @param Node\Name $name Namespace/Class to alias
* @param null|string $alias Alias
* @param int $type Type of the use element (for mixed group use declarations only)
* @param array $attributes Additional attributes
*/
public function __construct(Node\Name $name, $alias = null, array $attributes = array()) {
public function __construct(Node\Name $name, $alias = null, $type = Use_::TYPE_UNKNOWN, array $attributes = array()) {
if (null === $alias) {
$alias = $name->getLast();
}
@@ -31,12 +34,13 @@ class UseUse extends Node\Stmt
));
}
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->type = $type;
$this->name = $name;
$this->alias = $alias;
}
public function getSubNodeNames() {
return array('name', 'alias');
return array('type', 'name', 'alias');
}
}

View File

@@ -6,8 +6,17 @@ use PhpParser\Node\Stmt;
class Use_ extends Stmt
{
const TYPE_NORMAL = 1;
/**
* Unknown type. Both Stmt\Use_ / Stmt\GroupUse and Stmt\UseUse have a $type property, one of them will always be
* TYPE_UNKNOWN while the other has one of the three other possible types. For normal use statements the type on the
* Stmt\UseUse is unknown. It's only the other way around for mixed group use declarations.
*/
const TYPE_UNKNOWN = 0;
/** Class or namespace import */
const TYPE_NORMAL = 1;
/** Function import */
const TYPE_FUNCTION = 2;
/** Constant import */
const TYPE_CONSTANT = 3;
/** @var int Type of alias */
@@ -23,7 +32,7 @@ class Use_ extends Stmt
* @param array $attributes Additional attributes
*/
public function __construct(array $uses, $type = self::TYPE_NORMAL, array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->type = $type;
$this->uses = $uses;
}

View File

@@ -19,7 +19,7 @@ class While_ extends Node\Stmt
* @param array $attributes Additional attributes
*/
public function __construct(Node\Expr $cond, array $stmts = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
parent::__construct($attributes);
$this->cond = $cond;
$this->stmts = $stmts;
}