-
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip code changes on unresolvable/unknown classes (#4619)
* Added failling tests regarding unknown parents * Create skip_unknown_parent.php.inc * Create skip_unknown_parent.php.inc * Create skip_unknown_parent_class.php.inc * fix * fix * rename exception class
- Loading branch information
Showing
14 changed files
with
118 additions
and
12 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
packages/VendorLocker/Exception/UnresolvableClassException.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,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\VendorLocker\Exception; | ||
|
||
final class UnresolvableClassException extends \Exception | ||
{ | ||
} |
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
19 changes: 19 additions & 0 deletions
19
...on/Rector/ClassMethod/ParamTypeByMethodCallTypeRector/Fixture/skip_unknown_parent.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,19 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector\Fixture; | ||
|
||
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector\Source\GoOneWayInterface; | ||
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector\Source\SomeTypedService; | ||
|
||
final class SkipUnknownParent extends UnknownParentClass | ||
{ | ||
public function __construct( | ||
private SomeTypedService $someTypedService | ||
) { | ||
} | ||
|
||
public function go($value) | ||
{ | ||
$this->someTypedService->run($value); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...on/Rector/ClassMethod/ReturnTypeFromStrictParamRector/Fixture/skip_unknown_parent.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,9 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictParamRector\Fixture; | ||
|
||
class SkipUnknownParent extends UnknownParentClass { | ||
public function doFoo(SkipParentOverridden $param) { | ||
return $param; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...ion/Rector/ClassMethod/StrictArrayParamDimFetchRector/Fixture/skip_unknown_parent.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,13 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\StrictArrayParamDimFetchRector\Fixture; | ||
|
||
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\StrictArrayParamDimFetchRector\Source\SomeInterface; | ||
|
||
class SkipUnknownParent extends UnknownParentClass | ||
{ | ||
public function go($item) | ||
{ | ||
return $item['name']; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...or/Param/ParamTypeFromStrictTypedPropertyRector/Fixture/skip_unknown_parent_class.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,13 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Param\ParamTypeFromStrictTypedPropertyRector\Fixture; | ||
|
||
final class SkipUnknownParentClass extends UnknownParentClass | ||
{ | ||
private array $items = []; | ||
|
||
public function redirect(string $path, $args = []) | ||
{ | ||
$this->items = $args; | ||
} | ||
} |
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
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
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
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
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
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
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
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