2011-11-27 11:20:35 +01:00
|
|
|
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(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: A
|
|
|
|
)
|
2011-11-27 11:20:35 +01:00
|
|
|
stmts: array(
|
|
|
|
0: Stmt_ClassMethod(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2016-07-25 13:53:49 +02:00
|
|
|
flags: MODIFIER_PUBLIC (1)
|
2011-11-27 11:20:35 +01:00
|
|
|
byRef: false
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: a
|
|
|
|
)
|
2011-11-27 11:20:35 +01:00
|
|
|
params: array(
|
|
|
|
)
|
2015-03-12 13:17:31 +01:00
|
|
|
returnType: null
|
2011-11-27 11:20:35 +01:00
|
|
|
stmts: array(
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
1: Stmt_Class(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2016-07-25 13:33:19 +02:00
|
|
|
flags: 0
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: B
|
|
|
|
)
|
2011-11-27 11:20:35 +01:00
|
|
|
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
|
2017-04-28 19:09:39 +02:00
|
|
|
method: Identifier(
|
|
|
|
name: a
|
|
|
|
)
|
2016-07-25 13:53:49 +02:00
|
|
|
newModifier: MODIFIER_PROTECTED (2)
|
2017-04-28 19:09:39 +02:00
|
|
|
newName: Identifier(
|
|
|
|
name: b
|
|
|
|
)
|
2011-11-27 11:20:35 +01:00
|
|
|
)
|
|
|
|
1: Stmt_TraitUseAdaptation_Alias(
|
|
|
|
trait: null
|
2017-04-28 19:09:39 +02:00
|
|
|
method: Identifier(
|
|
|
|
name: c
|
|
|
|
)
|
2011-11-27 11:20:35 +01:00
|
|
|
newModifier: null
|
2017-04-28 19:09:39 +02:00
|
|
|
newName: Identifier(
|
|
|
|
name: d
|
|
|
|
)
|
2011-11-27 11:20:35 +01:00
|
|
|
)
|
|
|
|
2: Stmt_TraitUseAdaptation_Alias(
|
|
|
|
trait: null
|
2017-04-28 19:09:39 +02:00
|
|
|
method: Identifier(
|
|
|
|
name: e
|
|
|
|
)
|
2016-07-25 13:53:49 +02:00
|
|
|
newModifier: MODIFIER_PRIVATE (4)
|
2011-11-27 11:20:35 +01:00
|
|
|
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
|
|
|
|
)
|
|
|
|
)
|
2017-04-28 19:09:39 +02:00
|
|
|
method: Identifier(
|
|
|
|
name: a
|
|
|
|
)
|
2011-11-27 11:20:35 +01:00
|
|
|
insteadof: array(
|
|
|
|
0: Name(
|
|
|
|
parts: array(
|
|
|
|
0: F
|
|
|
|
)
|
|
|
|
)
|
|
|
|
1: Name(
|
|
|
|
parts: array(
|
|
|
|
0: G
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
1: Stmt_TraitUseAdaptation_Alias(
|
|
|
|
trait: Name(
|
|
|
|
parts: array(
|
|
|
|
0: E
|
|
|
|
)
|
|
|
|
)
|
2017-04-28 19:09:39 +02:00
|
|
|
method: Identifier(
|
|
|
|
name: b
|
|
|
|
)
|
2016-07-25 13:53:49 +02:00
|
|
|
newModifier: MODIFIER_PROTECTED (2)
|
2017-04-28 19:09:39 +02:00
|
|
|
newName: Identifier(
|
|
|
|
name: c
|
|
|
|
)
|
2011-11-27 11:20:35 +01:00
|
|
|
)
|
|
|
|
2: Stmt_TraitUseAdaptation_Alias(
|
|
|
|
trait: Name(
|
|
|
|
parts: array(
|
|
|
|
0: E
|
|
|
|
)
|
|
|
|
)
|
2017-04-28 19:09:39 +02:00
|
|
|
method: Identifier(
|
|
|
|
name: d
|
|
|
|
)
|
2011-11-27 11:20:35 +01:00
|
|
|
newModifier: null
|
2017-04-28 19:09:39 +02:00
|
|
|
newName: Identifier(
|
|
|
|
name: e
|
|
|
|
)
|
2011-11-27 11:20:35 +01:00
|
|
|
)
|
|
|
|
3: Stmt_TraitUseAdaptation_Alias(
|
|
|
|
trait: Name(
|
|
|
|
parts: array(
|
|
|
|
0: E
|
|
|
|
)
|
|
|
|
)
|
2017-04-28 19:09:39 +02:00
|
|
|
method: Identifier(
|
|
|
|
name: f
|
|
|
|
)
|
2016-07-25 13:53:49 +02:00
|
|
|
newModifier: MODIFIER_PRIVATE (4)
|
2011-11-27 11:20:35 +01:00
|
|
|
newName: null
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2016-07-25 13:33:19 +02:00
|
|
|
)
|