Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #128: Problem when I use parent:: in trait
- Loading branch information
Manuel Pichler
committed
Dec 4, 2014
1 parent
7aa2c5c
commit a73e6de
Showing
5 changed files
with
60 additions
and
4 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
21 changes: 21 additions & 0 deletions
21
...test/resources/files/Source/AST/ASTTrait/testTraitCanUseParentKeywordAsMethodTypeHint.php
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,21 @@ | ||
<?php | ||
trait testTraitCanUseParentKeywordAsMethodTypeHint | ||
{ | ||
public function baz(parent $foo) | ||
{ | ||
echo get_class($foo), PHP_EOL; | ||
} | ||
} | ||
|
||
class Foo { | ||
use testTraitCanUseParentKeywordAsMethodTypeHint; | ||
} | ||
|
||
class Bar { | ||
use testTraitCanUseParentKeywordAsMethodTypeHint; | ||
} | ||
|
||
$foo = new Foo(); | ||
$bar = new Bar(); | ||
|
||
$foo->baz($foo); |
8 changes: 8 additions & 0 deletions
8
src/test/resources/files/Source/AST/ASTTrait/testTraitCanUseParentKeywordInMethodBody.php
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,8 @@ | ||
<?php | ||
trait testTraitCanUseParentKeywordInMethodBody | ||
{ | ||
public function foo() | ||
{ | ||
parent::foo(); | ||
} | ||
} |