-
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AutoImport] Fixing auto import on multiple @\ usage (#5271)
* add fixture * [AutoImport] Fixing auto import on multiple @\ usage * more fixtures * more fixtures * fixing printer take 1 * fix partial * fix phpstan --------- Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
- Loading branch information
1 parent
189a026
commit e138f84
Showing
6 changed files
with
161 additions
and
20 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
16 changes: 16 additions & 0 deletions
16
tests/Issues/AutoImport/Fixture/DocBlock/skip_two_routes_with_prev_doc.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,16 @@ | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\AutoImport\Fixture\DocBlock; | ||
|
||
class TwoRoutesWithPrevDoc | ||
{ | ||
/** | ||
* @return Response | ||
* @\Symfony\Component\Routing\Annotation\Route("/first", methods={"GET"}) | ||
* @\Symfony\Component\Routing\Annotation\Route("/second", methods={"GET"}) | ||
*/ | ||
public function some(): Response | ||
{ | ||
return new Response(); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
tests/Issues/AutoImport/Fixture/DocBlock/two_routes.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,36 @@ | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\AutoImport\Fixture\DocBlock; | ||
|
||
class TwoRoutes | ||
{ | ||
/** | ||
* @\Symfony\Component\Routing\Annotation\Route("/first", methods={"GET"}) | ||
* @\Symfony\Component\Routing\Annotation\Route("/second", methods={"GET"}) | ||
*/ | ||
public function some(): Response | ||
{ | ||
return new Response(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\AutoImport\Fixture\DocBlock; | ||
|
||
use Symfony\Component\Routing\Annotation\Route; | ||
class TwoRoutes | ||
{ | ||
/** | ||
* @Route("/first", methods={"GET"}) | ||
* @Route("/second", methods={"GET"}) | ||
*/ | ||
public function some(): Response | ||
{ | ||
return new Response(); | ||
} | ||
} | ||
|
||
?> |
38 changes: 38 additions & 0 deletions
38
tests/Issues/AutoImport/Fixture/DocBlock/two_routes_with_next_doc.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,38 @@ | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\AutoImport\Fixture\DocBlock; | ||
|
||
class TwoRoutesWithNextDoc | ||
{ | ||
/** | ||
* @\Symfony\Component\Routing\Annotation\Route("/first", methods={"GET"}) | ||
* @\Symfony\Component\Routing\Annotation\Route("/second", methods={"GET"}) | ||
* @return Response | ||
*/ | ||
public function some(): Response | ||
{ | ||
return new Response(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\AutoImport\Fixture\DocBlock; | ||
|
||
use Symfony\Component\Routing\Annotation\Route; | ||
class TwoRoutesWithNextDoc | ||
{ | ||
/** | ||
* @Route("/first", methods={"GET"}) | ||
* @Route("/second", methods={"GET"}) | ||
* @return Response | ||
*/ | ||
public function some(): Response | ||
{ | ||
return new Response(); | ||
} | ||
} | ||
|
||
?> |
40 changes: 40 additions & 0 deletions
40
tests/Issues/AutoImport/Fixture/DocBlock/two_routes_with_next_doc_other_routes.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,40 @@ | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\AutoImport\Fixture\DocBlock; | ||
|
||
class TwoRoutesWithNextDoc2 | ||
{ | ||
/** | ||
* @\Symfony\Component\Routing\Annotation\Route("/first", methods={"GET"}) | ||
* @\Symfony\Component\Routing\Annotation\Route("/second", methods={"GET"}) | ||
* @return Response | ||
* @\Symfony\Component\Routing\Annotation\Route("/third", methods={"GET"}) | ||
*/ | ||
public function some(): Response | ||
{ | ||
return new Response(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\AutoImport\Fixture\DocBlock; | ||
|
||
use Symfony\Component\Routing\Annotation\Route; | ||
class TwoRoutesWithNextDoc2 | ||
{ | ||
/** | ||
* @Route("/first", methods={"GET"}) | ||
* @Route("/second", methods={"GET"}) | ||
* @return Response | ||
* @\Symfony\Component\Routing\Annotation\Route("/third", methods={"GET"}) | ||
*/ | ||
public function some(): Response | ||
{ | ||
return new Response(); | ||
} | ||
} | ||
|
||
?> |