Laravel version update

Laravel version update
This commit is contained in:
Manish Verma
2018-08-06 18:48:58 +05:30
parent d143048413
commit 126fbb0255
13678 changed files with 1031482 additions and 778530 deletions

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -18,13 +18,17 @@ class ArrayDimFetch extends Expr
* @param null|Expr $dim Array index / dim
* @param array $attributes Additional attributes
*/
public function __construct(Expr $var, Expr $dim = null, array $attributes = array()) {
public function __construct(Expr $var, Expr $dim = null, array $attributes = []) {
parent::__construct($attributes);
$this->var = $var;
$this->dim = $dim;
}
public function getSubnodeNames() {
return array('var', 'dim');
public function getSubNodeNames() : array {
return ['var', 'dim'];
}
public function getType() : string {
return 'Expr_ArrayDimFetch';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -21,14 +21,18 @@ class ArrayItem extends Expr
* @param bool $byRef Whether to assign by reference
* @param array $attributes Additional attributes
*/
public function __construct(Expr $value, Expr $key = null, $byRef = false, array $attributes = array()) {
public function __construct(Expr $value, Expr $key = null, bool $byRef = false, array $attributes = []) {
parent::__construct($attributes);
$this->key = $key;
$this->value = $value;
$this->byRef = $byRef;
}
public function getSubNodeNames() {
return array('key', 'value', 'byRef');
public function getSubNodeNames() : array {
return ['key', 'value', 'byRef'];
}
public function getType() : string {
return 'Expr_ArrayItem';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -19,12 +19,16 @@ class Array_ extends Expr
* @param ArrayItem[] $items Items of the array
* @param array $attributes Additional attributes
*/
public function __construct(array $items = array(), array $attributes = array()) {
public function __construct(array $items = [], array $attributes = []) {
parent::__construct($attributes);
$this->items = $items;
}
public function getSubNodeNames() {
return array('items');
public function getSubNodeNames() : array {
return ['items'];
}
public function getType() : string {
return 'Expr_Array';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -18,13 +18,17 @@ class Assign extends Expr
* @param Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $var, Expr $expr, array $attributes = array()) {
public function __construct(Expr $var, Expr $expr, array $attributes = []) {
parent::__construct($attributes);
$this->var = $var;
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('var', 'expr');
public function getSubNodeNames() : array {
return ['var', 'expr'];
}
public function getType() : string {
return 'Expr_Assign';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -18,13 +18,13 @@ abstract class AssignOp extends Expr
* @param Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $var, Expr $expr, array $attributes = array()) {
public function __construct(Expr $var, Expr $expr, array $attributes = []) {
parent::__construct($attributes);
$this->var = $var;
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('var', 'expr');
public function getSubNodeNames() : array {
return ['var', 'expr'];
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\AssignOp;
class BitwiseAnd extends AssignOp
{
}
public function getType() : string {
return 'Expr_AssignOp_BitwiseAnd';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\AssignOp;
class BitwiseOr extends AssignOp
{
}
public function getType() : string {
return 'Expr_AssignOp_BitwiseOr';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\AssignOp;
class BitwiseXor extends AssignOp
{
}
public function getType() : string {
return 'Expr_AssignOp_BitwiseXor';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\AssignOp;
class Concat extends AssignOp
{
}
public function getType() : string {
return 'Expr_AssignOp_Concat';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\AssignOp;
class Div extends AssignOp
{
}
public function getType() : string {
return 'Expr_AssignOp_Div';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\AssignOp;
class Minus extends AssignOp
{
}
public function getType() : string {
return 'Expr_AssignOp_Minus';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\AssignOp;
class Mod extends AssignOp
{
}
public function getType() : string {
return 'Expr_AssignOp_Mod';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\AssignOp;
class Mul extends AssignOp
{
}
public function getType() : string {
return 'Expr_AssignOp_Mul';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\AssignOp;
class Plus extends AssignOp
{
}
public function getType() : string {
return 'Expr_AssignOp_Plus';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\AssignOp;
class Pow extends AssignOp
{
}
public function getType() : string {
return 'Expr_AssignOp_Pow';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\AssignOp;
class ShiftLeft extends AssignOp
{
}
public function getType() : string {
return 'Expr_AssignOp_ShiftLeft';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\AssignOp;
class ShiftRight extends AssignOp
{
}
public function getType() : string {
return 'Expr_AssignOp_ShiftRight';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -18,13 +18,17 @@ class AssignRef extends Expr
* @param Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $var, Expr $expr, array $attributes = array()) {
public function __construct(Expr $var, Expr $expr, array $attributes = []) {
parent::__construct($attributes);
$this->var = $var;
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('var', 'expr');
public function getSubNodeNames() : array {
return ['var', 'expr'];
}
public function getType() : string {
return 'Expr_AssignRef';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -12,19 +12,29 @@ abstract class BinaryOp extends Expr
public $right;
/**
* Constructs a bitwise and node.
* Constructs a binary operator node.
*
* @param Expr $left The left hand side expression
* @param Expr $right The right hand side expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $left, Expr $right, array $attributes = array()) {
public function __construct(Expr $left, Expr $right, array $attributes = []) {
parent::__construct($attributes);
$this->left = $left;
$this->right = $right;
}
public function getSubNodeNames() {
return array('left', 'right');
public function getSubNodeNames() : array {
return ['left', 'right'];
}
/**
* Get the operator sigil for this binary operation.
*
* In the case there are multiple possible sigils for an operator, this method does not
* necessarily return the one used in the parsed code.
*
* @return string
*/
abstract public function getOperatorSigil() : string;
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class BitwiseAnd extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '&';
}
public function getType() : string {
return 'Expr_BinaryOp_BitwiseAnd';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class BitwiseOr extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '|';
}
public function getType() : string {
return 'Expr_BinaryOp_BitwiseOr';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class BitwiseXor extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '^';
}
public function getType() : string {
return 'Expr_BinaryOp_BitwiseXor';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class BooleanAnd extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '&&';
}
public function getType() : string {
return 'Expr_BinaryOp_BooleanAnd';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class BooleanOr extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '||';
}
public function getType() : string {
return 'Expr_BinaryOp_BooleanOr';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class Coalesce extends BinaryOp
{
public function getOperatorSigil() : string {
return '??';
}
public function getType() : string {
return 'Expr_BinaryOp_Coalesce';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class Concat extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '.';
}
public function getType() : string {
return 'Expr_BinaryOp_Concat';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class Div extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '/';
}
public function getType() : string {
return 'Expr_BinaryOp_Div';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class Equal extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '==';
}
public function getType() : string {
return 'Expr_BinaryOp_Equal';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class Greater extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '>';
}
public function getType() : string {
return 'Expr_BinaryOp_Greater';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class GreaterOrEqual extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '>=';
}
public function getType() : string {
return 'Expr_BinaryOp_GreaterOrEqual';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class Identical extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '===';
}
public function getType() : string {
return 'Expr_BinaryOp_Identical';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class LogicalAnd extends BinaryOp
{
}
public function getOperatorSigil() : string {
return 'and';
}
public function getType() : string {
return 'Expr_BinaryOp_LogicalAnd';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class LogicalOr extends BinaryOp
{
}
public function getOperatorSigil() : string {
return 'or';
}
public function getType() : string {
return 'Expr_BinaryOp_LogicalOr';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class LogicalXor extends BinaryOp
{
}
public function getOperatorSigil() : string {
return 'xor';
}
public function getType() : string {
return 'Expr_BinaryOp_LogicalXor';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class Minus extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '-';
}
public function getType() : string {
return 'Expr_BinaryOp_Minus';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class Mod extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '%';
}
public function getType() : string {
return 'Expr_BinaryOp_Mod';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class Mul extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '*';
}
public function getType() : string {
return 'Expr_BinaryOp_Mul';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class NotEqual extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '!=';
}
public function getType() : string {
return 'Expr_BinaryOp_NotEqual';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class NotIdentical extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '!==';
}
public function getType() : string {
return 'Expr_BinaryOp_NotIdentical';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class Plus extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '+';
}
public function getType() : string {
return 'Expr_BinaryOp_Plus';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class Pow extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '**';
}
public function getType() : string {
return 'Expr_BinaryOp_Pow';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class ShiftLeft extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '<<';
}
public function getType() : string {
return 'Expr_BinaryOp_ShiftLeft';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class ShiftRight extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '>>';
}
public function getType() : string {
return 'Expr_BinaryOp_ShiftRight';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class Smaller extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '<';
}
public function getType() : string {
return 'Expr_BinaryOp_Smaller';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class SmallerOrEqual extends BinaryOp
{
}
public function getOperatorSigil() : string {
return '<=';
}
public function getType() : string {
return 'Expr_BinaryOp_SmallerOrEqual';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
@@ -6,4 +6,11 @@ use PhpParser\Node\Expr\BinaryOp;
class Spaceship extends BinaryOp
{
public function getOperatorSigil() : string {
return '<=>';
}
public function getType() : string {
return 'Expr_BinaryOp_Spaceship';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class BitwiseNot extends Expr
* @param Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $expr, array $attributes = array()) {
public function __construct(Expr $expr, array $attributes = []) {
parent::__construct($attributes);
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('expr');
public function getSubNodeNames() : array {
return ['expr'];
}
public function getType() : string {
return 'Expr_BitwiseNot';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class BooleanNot extends Expr
* @param Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $expr, array $attributes = array()) {
public function __construct(Expr $expr, array $attributes = []) {
parent::__construct($attributes);
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('expr');
public function getSubNodeNames() : array {
return ['expr'];
}
public function getType() : string {
return 'Expr_BooleanNot';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,12 @@ abstract class Cast extends Expr
* @param Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $expr, array $attributes = array()) {
public function __construct(Expr $expr, array $attributes = []) {
parent::__construct($attributes);
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('expr');
public function getSubNodeNames() : array {
return ['expr'];
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\Cast;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\Cast;
class Array_ extends Cast
{
}
public function getType() : string {
return 'Expr_Cast_Array';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\Cast;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\Cast;
class Bool_ extends Cast
{
public function getType() : string {
return 'Expr_Cast_Bool';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\Cast;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\Cast;
class Double extends Cast
{
public function getType() : string {
return 'Expr_Cast_Double';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\Cast;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\Cast;
class Int_ extends Cast
{
public function getType() : string {
return 'Expr_Cast_Int';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\Cast;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\Cast;
class Object_ extends Cast
{
public function getType() : string {
return 'Expr_Cast_Object';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\Cast;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\Cast;
class String_ extends Cast
{
public function getType() : string {
return 'Expr_Cast_String';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\Cast;
@@ -6,4 +6,7 @@ use PhpParser\Node\Expr\Cast;
class Unset_ extends Cast
{
}
public function getType() : string {
return 'Expr_Cast_Unset';
}
}

View File

@@ -1,31 +1,36 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
use PhpParser\Node\Name;
use PhpParser\Node\Expr;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
class ClassConstFetch extends Expr
{
/** @var Name|Expr Class name */
public $class;
/** @var string Constant name */
/** @var Identifier|Error Constant name */
public $name;
/**
* Constructs a class const fetch node.
*
* @param Name|Expr $class Class name
* @param string $name Constant name
* @param array $attributes Additional attributes
* @param Name|Expr $class Class name
* @param string|Identifier|Error $name Constant name
* @param array $attributes Additional attributes
*/
public function __construct($class, $name, array $attributes = array()) {
public function __construct($class, $name, array $attributes = []) {
parent::__construct($attributes);
$this->class = $class;
$this->name = $name;
$this->name = \is_string($name) ? new Identifier($name) : $name;
}
public function getSubNodeNames() {
return array('class', 'name');
public function getSubNodeNames() : array {
return ['class', 'name'];
}
public function getType() : string {
return 'Expr_ClassConstFetch';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class Clone_ extends Expr
* @param Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $expr, array $attributes = array()) {
public function __construct(Expr $expr, array $attributes = []) {
parent::__construct($attributes);
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('expr');
public function getSubNodeNames() : array {
return ['expr'];
}
public function getType() : string {
return 'Expr_Clone';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -16,9 +16,9 @@ class Closure extends Expr implements FunctionLike
public $params;
/** @var ClosureUse[] use()s */
public $uses;
/** @var null|string|Node\Name Return type */
/** @var null|Node\Identifier|Node\Name|Node\NullableType Return type */
public $returnType;
/** @var Node[] Statements */
/** @var Node\Stmt[] Statements */
public $stmts;
/**
@@ -33,25 +33,26 @@ class Closure extends Expr implements FunctionLike
* 'stmts' => array(): Statements
* @param array $attributes Additional attributes
*/
public function __construct(array $subNodes = array(), array $attributes = array()) {
public function __construct(array $subNodes = [], array $attributes = []) {
parent::__construct($attributes);
$this->static = isset($subNodes['static']) ? $subNodes['static'] : false;
$this->byRef = isset($subNodes['byRef']) ? $subNodes['byRef'] : false;
$this->params = isset($subNodes['params']) ? $subNodes['params'] : array();
$this->uses = isset($subNodes['uses']) ? $subNodes['uses'] : array();
$this->returnType = isset($subNodes['returnType']) ? $subNodes['returnType'] : null;
$this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
$this->static = $subNodes['static'] ?? false;
$this->byRef = $subNodes['byRef'] ?? false;
$this->params = $subNodes['params'] ?? [];
$this->uses = $subNodes['uses'] ?? [];
$returnType = $subNodes['returnType'] ?? null;
$this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType;
$this->stmts = $subNodes['stmts'] ?? [];
}
public function getSubNodeNames() {
return array('static', 'byRef', 'params', 'uses', 'returnType', 'stmts');
public function getSubNodeNames() : array {
return ['static', 'byRef', 'params', 'uses', 'returnType', 'stmts'];
}
public function returnsByRef() {
public function returnsByRef() : bool {
return $this->byRef;
}
public function getParams() {
public function getParams() : array {
return $this->params;
}
@@ -59,7 +60,12 @@ class Closure extends Expr implements FunctionLike
return $this->returnType;
}
public function getStmts() {
/** @return Node\Stmt[] */
public function getStmts() : array {
return $this->stmts;
}
public function getType() : string {
return 'Expr_Closure';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -6,7 +6,7 @@ use PhpParser\Node\Expr;
class ClosureUse extends Expr
{
/** @var string Name of variable */
/** @var Expr\Variable Variable to use */
public $var;
/** @var bool Whether to use by reference */
public $byRef;
@@ -14,17 +14,21 @@ class ClosureUse extends Expr
/**
* Constructs a closure use node.
*
* @param string $var Name of variable
* @param bool $byRef Whether to use by reference
* @param array $attributes Additional attributes
* @param Expr\Variable $var Variable to use
* @param bool $byRef Whether to use by reference
* @param array $attributes Additional attributes
*/
public function __construct($var, $byRef = false, array $attributes = array()) {
public function __construct(Expr\Variable $var, bool $byRef = false, array $attributes = []) {
parent::__construct($attributes);
$this->var = $var;
$this->byRef = $byRef;
}
public function getSubNodeNames() {
return array('var', 'byRef');
public function getSubNodeNames() : array {
return ['var', 'byRef'];
}
public function getType() : string {
return 'Expr_ClosureUse';
}
}

View File

@@ -1,9 +1,9 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
use PhpParser\Node\Name;
use PhpParser\Node\Expr;
use PhpParser\Node\Name;
class ConstFetch extends Expr
{
@@ -16,12 +16,16 @@ class ConstFetch extends Expr
* @param Name $name Constant name
* @param array $attributes Additional attributes
*/
public function __construct(Name $name, array $attributes = array()) {
public function __construct(Name $name, array $attributes = []) {
parent::__construct($attributes);
$this->name = $name;
}
public function getSubNodeNames() {
return array('name');
public function getSubNodeNames() : array {
return ['name'];
}
public function getType() : string {
return 'Expr_ConstFetch';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class Empty_ extends Expr
* @param Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $expr, array $attributes = array()) {
public function __construct(Expr $expr, array $attributes = []) {
parent::__construct($attributes);
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('expr');
public function getSubNodeNames() : array {
return ['expr'];
}
public function getType() : string {
return 'Expr_Empty';
}
}

View File

@@ -0,0 +1,31 @@
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
use PhpParser\Node\Expr;
/**
* Error node used during parsing with error recovery.
*
* An error node may be placed at a position where an expression is required, but an error occurred.
* Error nodes will not be present if the parser is run in throwOnError mode (the default).
*/
class Error extends Expr
{
/**
* Constructs an error node.
*
* @param array $attributes Additional attributes
*/
public function __construct(array $attributes = []) {
parent::__construct($attributes);
}
public function getSubNodeNames() : array {
return [];
}
public function getType() : string {
return 'Expr_Error';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class ErrorSuppress extends Expr
* @param Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $expr, array $attributes = array()) {
public function __construct(Expr $expr, array $attributes = []) {
parent::__construct($attributes);
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('expr');
public function getSubNodeNames() : array {
return ['expr'];
}
public function getType() : string {
return 'Expr_ErrorSuppress';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class Eval_ extends Expr
* @param Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $expr, array $attributes = array()) {
public function __construct(Expr $expr, array $attributes = []) {
parent::__construct($attributes);
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('expr');
public function getSubNodeNames() : array {
return ['expr'];
}
public function getType() : string {
return 'Expr_Eval';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -19,12 +19,16 @@ class Exit_ extends Expr
* @param null|Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $expr = null, array $attributes = array()) {
public function __construct(Expr $expr = null, array $attributes = []) {
parent::__construct($attributes);
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('expr');
public function getSubNodeNames() : array {
return ['expr'];
}
public function getType() : string {
return 'Expr_Exit';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -16,16 +16,20 @@ class FuncCall extends Expr
* Constructs a function call node.
*
* @param Node\Name|Expr $name Function name
* @param Node\Arg[] $args Arguments
* @param array $attributes Additional attributes
* @param Node\Arg[] $args Arguments
* @param array $attributes Additional attributes
*/
public function __construct($name, array $args = array(), array $attributes = array()) {
public function __construct($name, array $args = [], array $attributes = []) {
parent::__construct($attributes);
$this->name = $name;
$this->args = $args;
}
public function getSubNodeNames() {
return array('name', 'args');
public function getSubNodeNames() : array {
return ['name', 'args'];
}
public function getType() : string {
return 'Expr_FuncCall';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -23,13 +23,17 @@ class Include_ extends Expr
* @param int $type Type of include
* @param array $attributes Additional attributes
*/
public function __construct(Expr $expr, $type, array $attributes = array()) {
public function __construct(Expr $expr, int $type, array $attributes = []) {
parent::__construct($attributes);
$this->expr = $expr;
$this->type = $type;
}
public function getSubNodeNames() {
return array('expr', 'type');
public function getSubNodeNames() : array {
return ['expr', 'type'];
}
public function getType() : string {
return 'Expr_Include';
}
}

View File

@@ -1,9 +1,9 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
use PhpParser\Node\Name;
use PhpParser\Node\Expr;
use PhpParser\Node\Name;
class Instanceof_ extends Expr
{
@@ -19,13 +19,17 @@ class Instanceof_ extends Expr
* @param Name|Expr $class Class name
* @param array $attributes Additional attributes
*/
public function __construct(Expr $expr, $class, array $attributes = array()) {
public function __construct(Expr $expr, $class, array $attributes = []) {
parent::__construct($attributes);
$this->expr = $expr;
$this->class = $class;
}
public function getSubNodeNames() {
return array('expr', 'class');
public function getSubNodeNames() : array {
return ['expr', 'class'];
}
public function getType() : string {
return 'Expr_Instanceof';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class Isset_ extends Expr
* @param Expr[] $vars Variables
* @param array $attributes Additional attributes
*/
public function __construct(array $vars, array $attributes = array()) {
public function __construct(array $vars, array $attributes = []) {
parent::__construct($attributes);
$this->vars = $vars;
}
public function getSubNodeNames() {
return array('vars');
public function getSubNodeNames() : array {
return ['vars'];
}
public function getType() : string {
return 'Expr_Isset';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -6,21 +6,25 @@ use PhpParser\Node\Expr;
class List_ extends Expr
{
/** @var Expr[] List of variables to assign to */
public $vars;
/** @var (ArrayItem|null)[] List of items to assign to */
public $items;
/**
* Constructs a list() destructuring node.
*
* @param Expr[] $vars List of variables to assign to
* @param array $attributes Additional attributes
* @param (ArrayItem|null)[] $items List of items to assign to
* @param array $attributes Additional attributes
*/
public function __construct(array $vars, array $attributes = array()) {
public function __construct(array $items, array $attributes = []) {
parent::__construct($attributes);
$this->vars = $vars;
$this->items = $items;
}
public function getSubNodeNames() {
return array('vars');
public function getSubNodeNames() : array {
return ['items'];
}
public function getType() : string {
return 'Expr_List';
}
}

View File

@@ -1,15 +1,16 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
use PhpParser\Node\Arg;
use PhpParser\Node\Expr;
use PhpParser\Node\Identifier;
class MethodCall extends Expr
{
/** @var Expr Variable holding object */
public $var;
/** @var string|Expr Method name */
/** @var Identifier|Expr Method name */
public $name;
/** @var Arg[] Arguments */
public $args;
@@ -17,19 +18,23 @@ class MethodCall extends Expr
/**
* Constructs a function call node.
*
* @param Expr $var Variable holding object
* @param string|Expr $name Method name
* @param Arg[] $args Arguments
* @param array $attributes Additional attributes
* @param Expr $var Variable holding object
* @param string|Identifier|Expr $name Method name
* @param Arg[] $args Arguments
* @param array $attributes Additional attributes
*/
public function __construct(Expr $var, $name, array $args = array(), array $attributes = array()) {
public function __construct(Expr $var, $name, array $args = [], array $attributes = []) {
parent::__construct($attributes);
$this->var = $var;
$this->name = $name;
$this->name = \is_string($name) ? new Identifier($name) : $name;
$this->args = $args;
}
public function getSubNodeNames() {
return array('var', 'name', 'args');
public function getSubNodeNames() : array {
return ['var', 'name', 'args'];
}
public function getType() : string {
return 'Expr_MethodCall';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -19,13 +19,17 @@ class New_ extends Expr
* @param Node\Arg[] $args Arguments
* @param array $attributes Additional attributes
*/
public function __construct($class, array $args = array(), array $attributes = array()) {
public function __construct($class, array $args = [], array $attributes = []) {
parent::__construct($attributes);
$this->class = $class;
$this->args = $args;
}
public function getSubNodeNames() {
return array('class', 'args');
public function getSubNodeNames() : array {
return ['class', 'args'];
}
public function getType() : string {
return 'Expr_New';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class PostDec extends Expr
* @param Expr $var Variable
* @param array $attributes Additional attributes
*/
public function __construct(Expr $var, array $attributes = array()) {
public function __construct(Expr $var, array $attributes = []) {
parent::__construct($attributes);
$this->var = $var;
}
public function getSubNodeNames() {
return array('var');
public function getSubNodeNames() : array {
return ['var'];
}
public function getType() : string {
return 'Expr_PostDec';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class PostInc extends Expr
* @param Expr $var Variable
* @param array $attributes Additional attributes
*/
public function __construct(Expr $var, array $attributes = array()) {
public function __construct(Expr $var, array $attributes = []) {
parent::__construct($attributes);
$this->var = $var;
}
public function getSubNodeNames() {
return array('var');
public function getSubNodeNames() : array {
return ['var'];
}
public function getType() : string {
return 'Expr_PostInc';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class PreDec extends Expr
* @param Expr $var Variable
* @param array $attributes Additional attributes
*/
public function __construct(Expr $var, array $attributes = array()) {
public function __construct(Expr $var, array $attributes = []) {
parent::__construct($attributes);
$this->var = $var;
}
public function getSubNodeNames() {
return array('var');
public function getSubNodeNames() : array {
return ['var'];
}
public function getType() : string {
return 'Expr_PreDec';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class PreInc extends Expr
* @param Expr $var Variable
* @param array $attributes Additional attributes
*/
public function __construct(Expr $var, array $attributes = array()) {
public function __construct(Expr $var, array $attributes = []) {
parent::__construct($attributes);
$this->var = $var;
}
public function getSubNodeNames() {
return array('var');
public function getSubNodeNames() : array {
return ['var'];
}
public function getType() : string {
return 'Expr_PreInc';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class Print_ extends Expr
* @param Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $expr, array $attributes = array()) {
public function __construct(Expr $expr, array $attributes = []) {
parent::__construct($attributes);
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('expr');
public function getSubNodeNames() : array {
return ['expr'];
}
public function getType() : string {
return 'Expr_Print';
}
}

View File

@@ -1,30 +1,35 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
use PhpParser\Node\Expr;
use PhpParser\Node\Identifier;
class PropertyFetch extends Expr
{
/** @var Expr Variable holding object */
public $var;
/** @var string|Expr Property name */
/** @var Identifier|Expr Property name */
public $name;
/**
* Constructs a function call node.
*
* @param Expr $var Variable holding object
* @param string|Expr $name Property name
* @param array $attributes Additional attributes
* @param Expr $var Variable holding object
* @param string|Identifier|Expr $name Property name
* @param array $attributes Additional attributes
*/
public function __construct(Expr $var, $name, array $attributes = array()) {
public function __construct(Expr $var, $name, array $attributes = []) {
parent::__construct($attributes);
$this->var = $var;
$this->name = $name;
$this->name = \is_string($name) ? new Identifier($name) : $name;
}
public function getSubNodeNames() {
return array('var', 'name');
public function getSubNodeNames() : array {
return ['var', 'name'];
}
public function getType() : string {
return 'Expr_PropertyFetch';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class ShellExec extends Expr
* @param array $parts Encapsed string array
* @param array $attributes Additional attributes
*/
public function __construct(array $parts, array $attributes = array()) {
public function __construct(array $parts, array $attributes = []) {
parent::__construct($attributes);
$this->parts = $parts;
}
public function getSubNodeNames() {
return array('parts');
public function getSubNodeNames() : array {
return ['parts'];
}
public function getType() : string {
return 'Expr_ShellExec';
}
}

View File

@@ -1,15 +1,16 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
use PhpParser\Node;
use PhpParser\Node\Expr;
use PhpParser\Node\Identifier;
class StaticCall extends Expr
{
/** @var Node\Name|Expr Class name */
public $class;
/** @var string|Expr Method name */
/** @var string|Identifier|Expr Method name */
public $name;
/** @var Node\Arg[] Arguments */
public $args;
@@ -17,19 +18,23 @@ class StaticCall extends Expr
/**
* Constructs a static method call node.
*
* @param Node\Name|Expr $class Class name
* @param string|Expr $name Method name
* @param Node\Arg[] $args Arguments
* @param array $attributes Additional attributes
* @param Node\Name|Expr $class Class name
* @param string|Identifier|Expr $name Method name
* @param Node\Arg[] $args Arguments
* @param array $attributes Additional attributes
*/
public function __construct($class, $name, array $args = array(), array $attributes = array()) {
public function __construct($class, $name, array $args = [], array $attributes = []) {
parent::__construct($attributes);
$this->class = $class;
$this->name = $name;
$this->name = \is_string($name) ? new Identifier($name) : $name;
$this->args = $args;
}
public function getSubNodeNames() {
return array('class', 'name', 'args');
public function getSubNodeNames() : array {
return ['class', 'name', 'args'];
}
public function getType() : string {
return 'Expr_StaticCall';
}
}

View File

@@ -1,31 +1,36 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
use PhpParser\Node\Name;
use PhpParser\Node\Expr;
use PhpParser\Node\Name;
use PhpParser\Node\VarLikeIdentifier;
class StaticPropertyFetch extends Expr
{
/** @var Name|Expr Class name */
public $class;
/** @var string|Expr Property name */
/** @var VarLikeIdentifier|Expr Property name */
public $name;
/**
* Constructs a static property fetch node.
*
* @param Name|Expr $class Class name
* @param string|Expr $name Property name
* @param array $attributes Additional attributes
* @param Name|Expr $class Class name
* @param string|VarLikeIdentifier|Expr $name Property name
* @param array $attributes Additional attributes
*/
public function __construct($class, $name, array $attributes = array()) {
public function __construct($class, $name, array $attributes = []) {
parent::__construct($attributes);
$this->class = $class;
$this->name = $name;
$this->name = \is_string($name) ? new VarLikeIdentifier($name) : $name;
}
public function getSubNodeNames() {
return array('class', 'name');
public function getSubNodeNames() : array {
return ['class', 'name'];
}
public function getType() : string {
return 'Expr_StaticPropertyFetch';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -21,14 +21,18 @@ class Ternary extends Expr
* @param Expr $else Expression for false
* @param array $attributes Additional attributes
*/
public function __construct(Expr $cond, $if, Expr $else, array $attributes = array()) {
public function __construct(Expr $cond, $if, Expr $else, array $attributes = []) {
parent::__construct($attributes);
$this->cond = $cond;
$this->if = $if;
$this->else = $else;
}
public function getSubNodeNames() {
return array('cond', 'if', 'else');
public function getSubNodeNames() : array {
return ['cond', 'if', 'else'];
}
public function getType() : string {
return 'Expr_Ternary';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class UnaryMinus extends Expr
* @param Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $expr, array $attributes = array()) {
public function __construct(Expr $expr, array $attributes = []) {
parent::__construct($attributes);
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('expr');
public function getSubNodeNames() : array {
return ['expr'];
}
public function getType() : string {
return 'Expr_UnaryMinus';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class UnaryPlus extends Expr
* @param Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $expr, array $attributes = array()) {
public function __construct(Expr $expr, array $attributes = []) {
parent::__construct($attributes);
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('expr');
public function getSubNodeNames() : array {
return ['expr'];
}
public function getType() : string {
return 'Expr_UnaryPlus';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class Variable extends Expr
* @param string|Expr $name Name
* @param array $attributes Additional attributes
*/
public function __construct($name, array $attributes = array()) {
public function __construct($name, array $attributes = []) {
parent::__construct($attributes);
$this->name = $name;
}
public function getSubNodeNames() {
return array('name');
public function getSubNodeNames() : array {
return ['name'];
}
public function getType() : string {
return 'Expr_Variable';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,16 @@ class YieldFrom extends Expr
* @param Expr $expr Expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $expr, array $attributes = array()) {
public function __construct(Expr $expr, array $attributes = []) {
parent::__construct($attributes);
$this->expr = $expr;
}
public function getSubNodeNames() {
return array('expr');
public function getSubNodeNames() : array {
return ['expr'];
}
public function getType() : string {
return 'Expr_YieldFrom';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -18,13 +18,17 @@ class Yield_ extends Expr
* @param null|Expr $key Key expression
* @param array $attributes Additional attributes
*/
public function __construct(Expr $value = null, Expr $key = null, array $attributes = array()) {
public function __construct(Expr $value = null, Expr $key = null, array $attributes = []) {
parent::__construct($attributes);
$this->key = $key;
$this->value = $value;
}
public function getSubNodeNames() {
return array('key', 'value');
public function getSubNodeNames() : array {
return ['key', 'value'];
}
public function getType() : string {
return 'Expr_Yield';
}
}