-
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Factory::fromClassReflection() added option to copy traits or not [Cl…
…oses #89]
- Loading branch information
Showing
8 changed files
with
194 additions
and
11 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
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
71 changes: 71 additions & 0 deletions
71
tests/PhpGenerator/expected/ClassType.from.trait-use.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,71 @@ | ||
/** | ||
* Trait1 | ||
*/ | ||
trait Trait1 | ||
{ | ||
public $x1; | ||
|
||
|
||
public function f1() | ||
{ | ||
echo 'Trait1::f1'; | ||
} | ||
} | ||
|
||
trait Trait2 | ||
{ | ||
use Trait1; | ||
|
||
protected $x2; | ||
|
||
|
||
public function f2() | ||
{ | ||
echo 'Trait2::f2'; | ||
} | ||
} | ||
|
||
class Class1 extends ParentClass | ||
{ | ||
use Trait2; | ||
} | ||
|
||
class Class2 extends ParentClass | ||
{ | ||
use Trait2; | ||
|
||
public function f1() | ||
{ | ||
echo 'Class2::f1'; | ||
} | ||
} | ||
|
||
class Class3 extends ParentClass | ||
{ | ||
use Trait2; | ||
|
||
/** info */ | ||
public $x1; | ||
|
||
|
||
public function f1() | ||
{ | ||
echo 'Class3::f1'; | ||
} | ||
} | ||
|
||
class Class4 extends ParentClass | ||
{ | ||
use Trait2; | ||
|
||
public function aliased() | ||
{ | ||
echo 'Class4::aliased'; | ||
} | ||
} | ||
|
||
class Class5 | ||
{ | ||
use Trait1; | ||
use Trait1b; | ||
} |
66 changes: 66 additions & 0 deletions
66
tests/PhpGenerator/expected/ClassType.from.trait-use.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,66 @@ | ||
/** | ||
* Trait1 | ||
*/ | ||
trait Trait1 | ||
{ | ||
public $x1; | ||
|
||
|
||
public function f1() | ||
{ | ||
} | ||
} | ||
|
||
trait Trait2 | ||
{ | ||
use Trait1; | ||
|
||
protected $x2; | ||
|
||
|
||
public function f2() | ||
{ | ||
} | ||
} | ||
|
||
class Class1 extends ParentClass | ||
{ | ||
use Trait2; | ||
} | ||
|
||
class Class2 extends ParentClass | ||
{ | ||
use Trait2; | ||
|
||
public function f1() | ||
{ | ||
} | ||
} | ||
|
||
class Class3 extends ParentClass | ||
{ | ||
use Trait2; | ||
|
||
/** info */ | ||
public $x1; | ||
|
||
|
||
public function f1() | ||
{ | ||
} | ||
} | ||
|
||
class Class4 extends ParentClass | ||
{ | ||
use Trait2; | ||
|
||
public function aliased() | ||
{ | ||
} | ||
} | ||
|
||
class Class5 | ||
{ | ||
use Trait1; | ||
use Trait1b; | ||
} |
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
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 |
---|---|---|
|
@@ -69,6 +69,7 @@ class Class3 extends ParentClass | |
Trait2::f1 as aliased; | ||
} | ||
|
||
/** info */ | ||
public $x1; | ||
|
||
|
||
|