-
-
Notifications
You must be signed in to change notification settings - Fork 670
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DowngradePhp70] Add class out of trait
- Loading branch information
1 parent
534f30d
commit c375193
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
...s/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/class_in_trait.php.inc
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,32 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DowngradePhp70\Rector\New_\DowngradeAnonymousClassRector\Fixture; | ||
|
||
trait ClassInTrait | ||
{ | ||
public function run() | ||
{ | ||
$message = 'error'; | ||
return new class($message) extends \InvalidArgumentException {}; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\DowngradePhp70\Rector\New_\DowngradeAnonymousClassRector\Fixture; | ||
|
||
class AnonymousFor_NotInFunction extends \InvalidArgumentException | ||
{ | ||
} | ||
trait ClassInTrait | ||
{ | ||
public function run() | ||
{ | ||
$message = 'error'; | ||
return new AnonymousFor_NotInFunction($message); | ||
} | ||
} | ||
|
||
?> |
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