-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
229 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
tests/PhpGenerator/expected/ClassType.from.trait.bodies.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/** | ||
* Trait1 | ||
*/ | ||
trait Trait1 | ||
{ | ||
public $x1; | ||
|
||
|
||
public function f1() | ||
{ | ||
echo 'Trait1::f1'; | ||
} | ||
} | ||
|
||
trait Trait2 | ||
{ | ||
protected $x2; | ||
public $x1; | ||
|
||
|
||
public function f2() | ||
{ | ||
echo 'Trait2::f2'; | ||
} | ||
|
||
|
||
public function f1() | ||
{ | ||
} | ||
} | ||
|
||
class Class1 extends ParentClass | ||
{ | ||
protected $x2; | ||
|
||
|
||
public function f1() | ||
{ | ||
} | ||
|
||
|
||
public function f2() | ||
{ | ||
} | ||
} | ||
|
||
class Class2 extends ParentClass | ||
{ | ||
public $x1; | ||
protected $x2; | ||
|
||
|
||
public function f1() | ||
{ | ||
echo 'Class2::f1'; | ||
} | ||
|
||
|
||
public function f2() | ||
{ | ||
} | ||
} | ||
|
||
class Class3 extends ParentClass | ||
{ | ||
public $x1; | ||
protected $x2; | ||
|
||
|
||
public function f1() | ||
{ | ||
echo 'Class3::f1'; | ||
} | ||
|
||
|
||
public function f2() | ||
{ | ||
} | ||
|
||
|
||
public function aliased() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Trait1 | ||
*/ | ||
trait Trait1 | ||
{ | ||
public $x1; | ||
|
||
|
||
public function f1() | ||
{ | ||
echo 'Trait1::f1'; | ||
} | ||
} | ||
|
||
|
||
trait Trait2 | ||
{ | ||
use Trait1; | ||
|
||
protected $x2; | ||
|
||
|
||
public function f2() | ||
{ | ||
echo 'Trait2::f2'; | ||
} | ||
} | ||
|
||
|
||
class ParentClass | ||
{ | ||
public $x1; | ||
|
||
|
||
public function f1() | ||
{ | ||
echo 'ParentClass::f1'; | ||
} | ||
} | ||
|
||
|
||
class Class1 extends ParentClass | ||
{ | ||
use Trait2; | ||
} | ||
|
||
|
||
class Class2 extends ParentClass | ||
{ | ||
use Trait2; | ||
|
||
public $x1; | ||
|
||
|
||
public function f1() | ||
{ | ||
echo 'Class2::f1'; | ||
} | ||
} | ||
|
||
|
||
class Class3 extends ParentClass | ||
{ | ||
use Trait2 { | ||
Trait2::f1 as aliased; | ||
} | ||
|
||
public $x1; | ||
|
||
|
||
public function f1() | ||
{ | ||
echo 'Class3::f1'; | ||
} | ||
} |