-
-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeDeclaration] Handle crash on func call not found on BoolReturnTy…
…peFromBooleanStrictReturnsRector (#6327) * [TypeDeclaration] Handle crash on func call not found on BoolReturnTypeFromBooleanStrictReturnsRector * Fixed 🎉 * add fixture for found
- Loading branch information
1 parent
398b04d
commit e74ecfb
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
.../ClassMethod/BoolReturnTypeFromBooleanStrictReturnsRector/Fixture/func_call_found.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,27 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\BoolReturnTypeFromBooleanStrictReturnsRector\Fixture; | ||
|
||
class FuncCallFound | ||
{ | ||
public function run() | ||
{ | ||
return in_array('a', ['a', 'b'], true); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\BoolReturnTypeFromBooleanStrictReturnsRector\Fixture; | ||
|
||
class FuncCallFound | ||
{ | ||
public function run(): bool | ||
{ | ||
return in_array('a', ['a', 'b'], true); | ||
} | ||
} | ||
|
||
?> |
11 changes: 11 additions & 0 deletions
11
...hod/BoolReturnTypeFromBooleanStrictReturnsRector/Fixture/skip_func_call_not_found.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,11 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\BoolReturnTypeFromBooleanStrictReturnsRector\Fixture; | ||
|
||
class SkipFuncCallNotFound | ||
{ | ||
public function run() | ||
{ | ||
return dt('some'); | ||
} | ||
} |
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