Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DeadCode] Remove AstResolver usage on RecastingRemovalRector (#5109)
* [DeadCode] Remove AstResolver usage on RecastingRemovalRector * add more fixture for external resource
- Loading branch information
1 parent
6a89b43
commit d7710f8
Showing
3 changed files
with
49 additions
and
10 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
...ector/Cast/RecastingRemovalRector/Fixture/method_call_return_string_type_external.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,33 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Cast\RecastingRemovalRector\Fixture; | ||
|
||
use Rector\Tests\DeadCode\Rector\Cast\RecastingRemovalRector\Source\ExternalStrictReturnType; | ||
|
||
class MethodCallReturnStrictTypeExternal | ||
{ | ||
public function run(): string | ||
{ | ||
$obj = new ExternalStrictReturnType(); | ||
return (string) $obj->getResult(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Cast\RecastingRemovalRector\Fixture; | ||
|
||
use Rector\Tests\DeadCode\Rector\Cast\RecastingRemovalRector\Source\ExternalStrictReturnType; | ||
|
||
class MethodCallReturnStrictTypeExternal | ||
{ | ||
public function run(): string | ||
{ | ||
$obj = new ExternalStrictReturnType(); | ||
return $obj->getResult(); | ||
} | ||
} | ||
|
||
?> |
13 changes: 13 additions & 0 deletions
13
rules-tests/DeadCode/Rector/Cast/RecastingRemovalRector/Source/ExternalStrictReturnType.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,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Cast\RecastingRemovalRector\Source; | ||
|
||
final class ExternalStrictReturnType | ||
{ | ||
public function getResult(): string | ||
{ | ||
return 'test'; | ||
} | ||
} |
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