-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VendorLocker] Allow both in vendor for child and parent on ParentCla…
…ssMethodTypeOverrideGuard (#1399) * [VendorLocker] Allow both in vendor for child and parent on ParentClassMethodTypeOverrideGuard * fix check * add test from anonymous class to check that file name of current class method will always found
- Loading branch information
1 parent
29562a6
commit dda87fc
Showing
3 changed files
with
66 additions
and
1 deletion.
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
31 changes: 31 additions & 0 deletions
31
...s/TypeDeclaration/Rector/ClassMethod/ReturnNeverTypeRector/Fixture/from_anonymous.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,31 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector\Fixture; | ||
|
||
use Exception; | ||
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector\Source\MixedReturn; | ||
|
||
new class implements MixedReturn { | ||
public function run() | ||
{ | ||
throw new Exception('test'); | ||
} | ||
}; | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector\Fixture; | ||
|
||
use Exception; | ||
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector\Source\MixedReturn; | ||
|
||
new class implements MixedReturn { | ||
public function run(): never | ||
{ | ||
throw new Exception('test'); | ||
} | ||
}; | ||
|
||
?> |
10 changes: 10 additions & 0 deletions
10
rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnNeverTypeRector/Source/MixedReturn.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,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector\Source; | ||
|
||
interface MixedReturn | ||
{ | ||
public function run(); | ||
} |