-
-
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.
[AutoImport] Add support for auto import in alias same last name (#2952)
* [AutoImport] Add support for auto import in alias same last name * implemented 🎉 * ensure alias not just renamed * [ci-review] Rector Rectify * final touch: add fixture for skip different fqcn * really final touch: clean up * add failing fixture * more test * stub unused * progress * Fix Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
429c9c0
commit 2015f46
Showing
7 changed files
with
167 additions
and
13 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
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
39 changes: 39 additions & 0 deletions
39
tests/Issues/AutoImportInAlias/Fixture/auto_import_in_alias_same_last_name.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,39 @@ | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\AutoImportInAlias\Fixture; | ||
|
||
use PhpParser\Node\Expr\BinaryOp\Plus; | ||
use PhpParser\Node\Expr\AssignOp\Plus as AssignPlus; | ||
|
||
final class AutoImportInAliasSameLastName | ||
{ | ||
public function run(\PhpParser\Node\Expr\BinaryOp\Plus $plus) | ||
{ | ||
} | ||
|
||
public function run2(AssignPlus $plus) | ||
{ | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\AutoImportInAlias\Fixture; | ||
|
||
use PhpParser\Node\Expr\BinaryOp\Plus; | ||
use PhpParser\Node\Expr\AssignOp\Plus as AssignPlus; | ||
|
||
final class AutoImportInAliasSameLastName | ||
{ | ||
public function run(Plus $plus) | ||
{ | ||
} | ||
|
||
public function run2(AssignPlus $plus) | ||
{ | ||
} | ||
} | ||
|
||
?> |
17 changes: 17 additions & 0 deletions
17
...AutoImportInAlias/Fixture/skip_auto_import_in_alias_same_last_name_different_fqcn.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,17 @@ | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\AutoImportInAlias\Fixture; | ||
|
||
use PhpParser\Node\Expr\BinaryOp\Plus; | ||
use PhpParser\Node\Expr\AssignOp\Plus as AssignPlus; | ||
|
||
final class SkipAutoImportInAliasSameLastNameDifferentFqcn | ||
{ | ||
public function run(\Rector\Core\Tests\Issues\AutoImportInAlias\Source\Plus $plus) | ||
{ | ||
} | ||
|
||
public function run2(AssignPlus $plus) | ||
{ | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...utoImportInAlias/Fixture/skip_auto_import_in_alias_same_last_name_different_fqcn2.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,17 @@ | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\AutoImportInAlias\Fixture; | ||
|
||
use PhpParser\Node\Expr\BinaryOp\Plus; | ||
use PhpParser\Node\Expr\AssignOp\Plus as AssignPlus; | ||
|
||
final class SkipAutoImportInAliasSameLastNameDifferentFqcn2 | ||
{ | ||
public function run(\Plus $plus) | ||
{ | ||
} | ||
|
||
public function run2(AssignPlus $plus) | ||
{ | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...utoImportInAlias/Fixture/skip_auto_import_in_alias_same_last_name_different_fqcn3.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,17 @@ | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\AutoImportInAlias\Fixture; | ||
|
||
use PhpParser\Node\Expr\BinaryOp\Plus; | ||
use PhpParser\Node\Expr\AssignOp\Plus as AssignPlus; | ||
|
||
final class SkipAutoImportInAliasSameLastNameDifferentFqcn3 | ||
{ | ||
public function run(\Plus $plus) | ||
{ | ||
} | ||
|
||
public function run2(\AssignPlus $plus) | ||
{ | ||
} | ||
} |