mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 09:32:24 -04:00
Add Composer autoloading functions and PHPStan for testing
This commit is contained in:
parent
e198c4db65
commit
f5d7d4e02a
1518 changed files with 169063 additions and 30 deletions
45
vendor/nikic/php-parser/test/code/parser/stmt/class/abstract.test
vendored
Normal file
45
vendor/nikic/php-parser/test/code/parser/stmt/class/abstract.test
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
Abstract class
|
||||
-----
|
||||
<?php
|
||||
|
||||
abstract class A {
|
||||
public function a() {}
|
||||
abstract public function b();
|
||||
}
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: MODIFIER_ABSTRACT (16)
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
1: Stmt_ClassMethod(
|
||||
flags: MODIFIER_PUBLIC | MODIFIER_ABSTRACT (17)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
214
vendor/nikic/php-parser/test/code/parser/stmt/class/anonymous.test
vendored
Normal file
214
vendor/nikic/php-parser/test/code/parser/stmt/class/anonymous.test
vendored
Normal file
|
@ -0,0 +1,214 @@
|
|||
Anonymous classes
|
||||
-----
|
||||
<?php
|
||||
|
||||
new class {
|
||||
public function test() {}
|
||||
};
|
||||
new class extends A implements B, C {};
|
||||
new class() {
|
||||
public $foo;
|
||||
};
|
||||
new class($a, $b) extends A {
|
||||
use T;
|
||||
};
|
||||
|
||||
class A {
|
||||
public function test() {
|
||||
return new class($this) extends A {
|
||||
const A = 'B';
|
||||
};
|
||||
}
|
||||
}
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Stmt_Class(
|
||||
flags: 0
|
||||
name: null
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: test
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Stmt_Class(
|
||||
flags: 0
|
||||
name: null
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
implements: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
)
|
||||
)
|
||||
1: Name(
|
||||
parts: array(
|
||||
0: C
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Stmt_Class(
|
||||
flags: 0
|
||||
name: null
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
type: null
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: foo
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Stmt_Class(
|
||||
flags: 0
|
||||
name: null
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_TraitUse(
|
||||
traits: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: T
|
||||
)
|
||||
)
|
||||
)
|
||||
adaptations: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
1: Arg(
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: test
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
0: Stmt_Return(
|
||||
expr: Expr_New(
|
||||
class: Stmt_Class(
|
||||
flags: 0
|
||||
name: null
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassConst(
|
||||
flags: 0
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: this
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
35
vendor/nikic/php-parser/test/code/parser/stmt/class/conditional.test
vendored
Normal file
35
vendor/nikic/php-parser/test/code/parser/stmt/class/conditional.test
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
Conditional class definition
|
||||
-----
|
||||
<?php
|
||||
|
||||
if (true) {
|
||||
class A {}
|
||||
}
|
||||
-----
|
||||
array(
|
||||
0: Stmt_If(
|
||||
cond: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: true
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
elseifs: array(
|
||||
)
|
||||
else: null
|
||||
)
|
||||
)
|
137
vendor/nikic/php-parser/test/code/parser/stmt/class/constModifierErrors.test
vendored
Normal file
137
vendor/nikic/php-parser/test/code/parser/stmt/class/constModifierErrors.test
vendored
Normal file
|
@ -0,0 +1,137 @@
|
|||
Invalid class constant modifiers
|
||||
-----
|
||||
<?php
|
||||
class A {
|
||||
static const X = 1;
|
||||
}
|
||||
-----
|
||||
!!php7
|
||||
Cannot use 'static' as constant modifier from 3:5 to 3:10
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassConst(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: X
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
class A {
|
||||
abstract const X = 1;
|
||||
}
|
||||
-----
|
||||
!!php7
|
||||
Cannot use 'abstract' as constant modifier from 3:5 to 3:12
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassConst(
|
||||
flags: MODIFIER_ABSTRACT (16)
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: X
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
class A {
|
||||
final const X = 1;
|
||||
}
|
||||
-----
|
||||
!!php7
|
||||
Cannot use 'final' as constant modifier from 3:5 to 3:9
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassConst(
|
||||
flags: MODIFIER_FINAL (32)
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: X
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
class A {
|
||||
public public const X = 1;
|
||||
}
|
||||
-----
|
||||
!!php7
|
||||
Multiple access type modifiers are not allowed from 3:12 to 3:17
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassConst(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: X
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
77
vendor/nikic/php-parser/test/code/parser/stmt/class/constModifiers.test
vendored
Normal file
77
vendor/nikic/php-parser/test/code/parser/stmt/class/constModifiers.test
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
Class constant modifiers
|
||||
-----
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
const A = 1;
|
||||
public const B = 2;
|
||||
protected const C = 3;
|
||||
private const D = 4;
|
||||
}
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: Foo
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassConst(
|
||||
flags: 0
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_ClassConst(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: B
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_ClassConst(
|
||||
flags: MODIFIER_PROTECTED (2)
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: C
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_ClassConst(
|
||||
flags: MODIFIER_PRIVATE (4)
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: D
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 4
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
19
vendor/nikic/php-parser/test/code/parser/stmt/class/final.test
vendored
Normal file
19
vendor/nikic/php-parser/test/code/parser/stmt/class/final.test
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
Final class
|
||||
-----
|
||||
<?php
|
||||
|
||||
final class A {}
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: MODIFIER_FINAL (32)
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
110
vendor/nikic/php-parser/test/code/parser/stmt/class/implicitPublic.test
vendored
Normal file
110
vendor/nikic/php-parser/test/code/parser/stmt/class/implicitPublic.test
vendored
Normal file
|
@ -0,0 +1,110 @@
|
|||
Implicitly public properties and methods
|
||||
-----
|
||||
<?php
|
||||
|
||||
abstract class A {
|
||||
var $a;
|
||||
static $b;
|
||||
abstract function c();
|
||||
final function d() {}
|
||||
static function e() {}
|
||||
final static function f() {}
|
||||
function g() {}
|
||||
}
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: MODIFIER_ABSTRACT (16)
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: 0
|
||||
type: null
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Property(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
type: null
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: b
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_ClassMethod(
|
||||
flags: MODIFIER_ABSTRACT (16)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: c
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: null
|
||||
)
|
||||
3: Stmt_ClassMethod(
|
||||
flags: MODIFIER_FINAL (32)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: d
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
4: Stmt_ClassMethod(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: e
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
5: Stmt_ClassMethod(
|
||||
flags: MODIFIER_STATIC | MODIFIER_FINAL (40)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: f
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
6: Stmt_ClassMethod(
|
||||
flags: 0
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: g
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
40
vendor/nikic/php-parser/test/code/parser/stmt/class/interface.test
vendored
Normal file
40
vendor/nikic/php-parser/test/code/parser/stmt/class/interface.test
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
Interface
|
||||
-----
|
||||
<?php
|
||||
|
||||
interface A extends C, D {
|
||||
public function a();
|
||||
}
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Interface(
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: C
|
||||
)
|
||||
)
|
||||
1: Name(
|
||||
parts: array(
|
||||
0: D
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
254
vendor/nikic/php-parser/test/code/parser/stmt/class/modifier.test
vendored
Normal file
254
vendor/nikic/php-parser/test/code/parser/stmt/class/modifier.test
vendored
Normal file
|
@ -0,0 +1,254 @@
|
|||
Invalid modifier combination
|
||||
-----
|
||||
<?php class A { public public $a; }
|
||||
-----
|
||||
Multiple access type modifiers are not allowed from 1:24 to 1:29
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
type: null
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { public protected $a; }
|
||||
-----
|
||||
Multiple access type modifiers are not allowed from 1:24 to 1:32
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: MODIFIER_PUBLIC | MODIFIER_PROTECTED (3)
|
||||
type: null
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { abstract abstract function a(); }
|
||||
-----
|
||||
Multiple abstract modifiers are not allowed from 1:26 to 1:33
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_ABSTRACT (16)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { static static $a; }
|
||||
-----
|
||||
Multiple static modifiers are not allowed from 1:24 to 1:29
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
type: null
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { final final function a() {} }
|
||||
-----
|
||||
Multiple final modifiers are not allowed from 1:23 to 1:27
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_FINAL (32)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { abstract final function a(); }
|
||||
-----
|
||||
Cannot use the final modifier on an abstract class member from 1:26 to 1:30
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_ABSTRACT | MODIFIER_FINAL (48)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php abstract final class A { }
|
||||
// Type in the partial parse could conceivably be any of 0, 16 or 32
|
||||
-----
|
||||
Syntax error, unexpected T_FINAL, expecting T_CLASS from 1:16 to 1:20
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: MODIFIER_FINAL (32)
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
1: Stmt_Nop(
|
||||
comments: array(
|
||||
0: // Type in the partial parse could conceivably be any of 0, 16 or 32
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { abstract $a; }
|
||||
-----
|
||||
Properties cannot be declared abstract from 1:17 to 1:24
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: MODIFIER_ABSTRACT (16)
|
||||
type: null
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { final $a; }
|
||||
-----
|
||||
Properties cannot be declared final from 1:17 to 1:21
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: MODIFIER_FINAL (32)
|
||||
type: null
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
266
vendor/nikic/php-parser/test/code/parser/stmt/class/name.test
vendored
Normal file
266
vendor/nikic/php-parser/test/code/parser/stmt/class/name.test
vendored
Normal file
|
@ -0,0 +1,266 @@
|
|||
Invalid class name
|
||||
-----
|
||||
<?php class self {}
|
||||
-----
|
||||
Cannot use 'self' as class name as it is reserved from 1:13 to 1:16
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: self
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class PARENT {}
|
||||
-----
|
||||
Cannot use 'PARENT' as class name as it is reserved from 1:13 to 1:18
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: PARENT
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class static {}
|
||||
-----
|
||||
Syntax error, unexpected T_STATIC, expecting T_STRING from 1:13 to 1:18
|
||||
array(
|
||||
)
|
||||
-----
|
||||
<?php class A extends self {}
|
||||
-----
|
||||
Cannot use 'self' as class name as it is reserved from 1:23 to 1:26
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: self
|
||||
)
|
||||
)
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A extends PARENT {}
|
||||
-----
|
||||
Cannot use 'PARENT' as class name as it is reserved from 1:23 to 1:28
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: PARENT
|
||||
)
|
||||
)
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A extends static {}
|
||||
-----
|
||||
Cannot use 'static' as class name as it is reserved from 1:23 to 1:28
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: static
|
||||
)
|
||||
)
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A implements self {}
|
||||
-----
|
||||
Cannot use 'self' as interface name as it is reserved from 1:26 to 1:29
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: self
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A implements PARENT {}
|
||||
-----
|
||||
Cannot use 'PARENT' as interface name as it is reserved from 1:26 to 1:31
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: PARENT
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A implements static {}
|
||||
-----
|
||||
Cannot use 'static' as interface name as it is reserved from 1:26 to 1:31
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: static
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php interface self {}
|
||||
-----
|
||||
Cannot use 'self' as class name as it is reserved from 1:17 to 1:20
|
||||
array(
|
||||
0: Stmt_Interface(
|
||||
name: Identifier(
|
||||
name: self
|
||||
)
|
||||
extends: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php interface PARENT {}
|
||||
-----
|
||||
Cannot use 'PARENT' as class name as it is reserved from 1:17 to 1:22
|
||||
array(
|
||||
0: Stmt_Interface(
|
||||
name: Identifier(
|
||||
name: PARENT
|
||||
)
|
||||
extends: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php interface static {}
|
||||
-----
|
||||
Syntax error, unexpected T_STATIC, expecting T_STRING from 1:17 to 1:22
|
||||
array(
|
||||
)
|
||||
-----
|
||||
<?php interface A extends self {}
|
||||
-----
|
||||
Cannot use 'self' as interface name as it is reserved from 1:27 to 1:30
|
||||
array(
|
||||
0: Stmt_Interface(
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: self
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php interface A extends PARENT {}
|
||||
-----
|
||||
Cannot use 'PARENT' as interface name as it is reserved from 1:27 to 1:32
|
||||
array(
|
||||
0: Stmt_Interface(
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: PARENT
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php interface A extends static {}
|
||||
-----
|
||||
Cannot use 'static' as interface name as it is reserved from 1:27 to 1:32
|
||||
array(
|
||||
0: Stmt_Interface(
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: static
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
59
vendor/nikic/php-parser/test/code/parser/stmt/class/php4Style.test
vendored
Normal file
59
vendor/nikic/php-parser/test/code/parser/stmt/class/php4Style.test
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
PHP 4 style declarations
|
||||
-----
|
||||
<?php
|
||||
|
||||
class A {
|
||||
var $foo;
|
||||
function bar() {}
|
||||
static abstract function baz() {}
|
||||
}
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: 0
|
||||
type: null
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: foo
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_ClassMethod(
|
||||
flags: 0
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: bar
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
2: Stmt_ClassMethod(
|
||||
flags: MODIFIER_ABSTRACT | MODIFIER_STATIC (24)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: baz
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
70
vendor/nikic/php-parser/test/code/parser/stmt/class/propertyTypes.test
vendored
Normal file
70
vendor/nikic/php-parser/test/code/parser/stmt/class/propertyTypes.test
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
Class declaration
|
||||
-----
|
||||
<?php
|
||||
|
||||
class A {
|
||||
public string $a;
|
||||
protected static D $b;
|
||||
private ?float $c;
|
||||
}
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
type: Identifier(
|
||||
name: string
|
||||
)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Property(
|
||||
flags: MODIFIER_PROTECTED | MODIFIER_STATIC (10)
|
||||
type: Name(
|
||||
parts: array(
|
||||
0: D
|
||||
)
|
||||
)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: b
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Property(
|
||||
flags: MODIFIER_PRIVATE (4)
|
||||
type: NullableType(
|
||||
type: Identifier(
|
||||
name: float
|
||||
)
|
||||
)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: c
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
185
vendor/nikic/php-parser/test/code/parser/stmt/class/simple.test
vendored
Normal file
185
vendor/nikic/php-parser/test/code/parser/stmt/class/simple.test
vendored
Normal file
|
@ -0,0 +1,185 @@
|
|||
Class declaration
|
||||
-----
|
||||
<?php
|
||||
|
||||
class A extends B implements C, D {
|
||||
const A = 'B', C = 'D';
|
||||
|
||||
public $a = 'b', $c = 'd';
|
||||
protected $e;
|
||||
private $f;
|
||||
|
||||
public function a() {}
|
||||
public static function b($a) {}
|
||||
public final function c() : B {}
|
||||
protected function d() {}
|
||||
private function e() {}
|
||||
}
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
)
|
||||
)
|
||||
implements: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: C
|
||||
)
|
||||
)
|
||||
1: Name(
|
||||
parts: array(
|
||||
0: D
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassConst(
|
||||
flags: 0
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: B
|
||||
)
|
||||
)
|
||||
1: Const(
|
||||
name: Identifier(
|
||||
name: C
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: D
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Property(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
type: null
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
1: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: c
|
||||
)
|
||||
default: Scalar_String(
|
||||
value: d
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Property(
|
||||
flags: MODIFIER_PROTECTED (2)
|
||||
type: null
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: e
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Property(
|
||||
flags: MODIFIER_PRIVATE (4)
|
||||
type: null
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: f
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_ClassMethod(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
5: Stmt_ClassMethod(
|
||||
flags: MODIFIER_PUBLIC | MODIFIER_STATIC (9)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
6: Stmt_ClassMethod(
|
||||
flags: MODIFIER_PUBLIC | MODIFIER_FINAL (33)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: c
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
7: Stmt_ClassMethod(
|
||||
flags: MODIFIER_PROTECTED (2)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: d
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
8: Stmt_ClassMethod(
|
||||
flags: MODIFIER_PRIVATE (4)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: e
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
175
vendor/nikic/php-parser/test/code/parser/stmt/class/staticMethod.test
vendored
Normal file
175
vendor/nikic/php-parser/test/code/parser/stmt/class/staticMethod.test
vendored
Normal file
|
@ -0,0 +1,175 @@
|
|||
Some special methods cannot be static
|
||||
-----
|
||||
<?php class A { static function __construct() {} }
|
||||
-----
|
||||
Constructor __construct() cannot be static from 1:17 to 1:22
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: __construct
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { static function __destruct() {} }
|
||||
-----
|
||||
Destructor __destruct() cannot be static from 1:17 to 1:22
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: __destruct
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { static function __clone() {} }
|
||||
-----
|
||||
Clone method __clone() cannot be static from 1:17 to 1:22
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: __clone
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { static function __CONSTRUCT() {} }
|
||||
-----
|
||||
Constructor __CONSTRUCT() cannot be static from 1:17 to 1:22
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: __CONSTRUCT
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { static function __Destruct() {} }
|
||||
-----
|
||||
Destructor __Destruct() cannot be static from 1:17 to 1:22
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: __Destruct
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { static function __cLoNe() {} }
|
||||
-----
|
||||
Clone method __cLoNe() cannot be static from 1:17 to 1:22
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: __cLoNe
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
188
vendor/nikic/php-parser/test/code/parser/stmt/class/trait.test
vendored
Normal file
188
vendor/nikic/php-parser/test/code/parser/stmt/class/trait.test
vendored
Normal file
|
@ -0,0 +1,188 @@
|
|||
Traits
|
||||
-----
|
||||
<?php
|
||||
|
||||
trait A {
|
||||
public function a() {}
|
||||
}
|
||||
|
||||
class B {
|
||||
use C;
|
||||
use D {
|
||||
a as protected b;
|
||||
c as d;
|
||||
e as private;
|
||||
}
|
||||
use E, F, G {
|
||||
E::a insteadof F, G;
|
||||
E::b as protected c;
|
||||
E::d as e;
|
||||
E::f as private;
|
||||
}
|
||||
}
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Trait(
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: B
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_TraitUse(
|
||||
traits: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: C
|
||||
)
|
||||
)
|
||||
)
|
||||
adaptations: array(
|
||||
)
|
||||
)
|
||||
1: Stmt_TraitUse(
|
||||
traits: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: D
|
||||
)
|
||||
)
|
||||
)
|
||||
adaptations: array(
|
||||
0: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: null
|
||||
method: Identifier(
|
||||
name: a
|
||||
)
|
||||
newModifier: MODIFIER_PROTECTED (2)
|
||||
newName: Identifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
1: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: null
|
||||
method: Identifier(
|
||||
name: c
|
||||
)
|
||||
newModifier: null
|
||||
newName: Identifier(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
2: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: null
|
||||
method: Identifier(
|
||||
name: e
|
||||
)
|
||||
newModifier: MODIFIER_PRIVATE (4)
|
||||
newName: null
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_TraitUse(
|
||||
traits: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: E
|
||||
)
|
||||
)
|
||||
1: Name(
|
||||
parts: array(
|
||||
0: F
|
||||
)
|
||||
)
|
||||
2: Name(
|
||||
parts: array(
|
||||
0: G
|
||||
)
|
||||
)
|
||||
)
|
||||
adaptations: array(
|
||||
0: Stmt_TraitUseAdaptation_Precedence(
|
||||
trait: Name(
|
||||
parts: array(
|
||||
0: E
|
||||
)
|
||||
)
|
||||
method: Identifier(
|
||||
name: a
|
||||
)
|
||||
insteadof: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: F
|
||||
)
|
||||
)
|
||||
1: Name(
|
||||
parts: array(
|
||||
0: G
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: Name(
|
||||
parts: array(
|
||||
0: E
|
||||
)
|
||||
)
|
||||
method: Identifier(
|
||||
name: b
|
||||
)
|
||||
newModifier: MODIFIER_PROTECTED (2)
|
||||
newName: Identifier(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
2: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: Name(
|
||||
parts: array(
|
||||
0: E
|
||||
)
|
||||
)
|
||||
method: Identifier(
|
||||
name: d
|
||||
)
|
||||
newModifier: null
|
||||
newName: Identifier(
|
||||
name: e
|
||||
)
|
||||
)
|
||||
3: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: Name(
|
||||
parts: array(
|
||||
0: E
|
||||
)
|
||||
)
|
||||
method: Identifier(
|
||||
name: f
|
||||
)
|
||||
newModifier: MODIFIER_PRIVATE (4)
|
||||
newName: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue