-
-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix type without class name mapping without substracted type (#1104)
- Loading branch information
1 parent
99f0681
commit a7d8b39
Showing
3 changed files
with
55 additions
and
15 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
53 changes: 53 additions & 0 deletions
53
.../ClassMethod/AddMethodCallBasedStrictParamTypeRector/Fixture/skip_instanceof_enum.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,53 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector\Fixture; | ||
|
||
use MyCLabs\Enum\Enum; | ||
|
||
final class SkipInstanceOfEnum | ||
{ | ||
public function run(object $object) | ||
{ | ||
if ($object instanceof Enum) { | ||
return; | ||
} | ||
|
||
return $this->processTheRest($object); | ||
} | ||
|
||
private function processTheRest($object) | ||
{ | ||
return $object; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector\Fixture; | ||
|
||
use MyCLabs\Enum\Enum; | ||
|
||
final class SkipInstanceOfEnum | ||
{ | ||
public function run(object $object) | ||
{ | ||
if ($object instanceof Enum) { | ||
return; | ||
} | ||
|
||
return $this->processTheRest($object); | ||
} | ||
|
||
private function processTheRest(object $object) | ||
{ | ||
return $object; | ||
} | ||
} | ||
|
||
?> |
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