-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AutoImport][Php70] Keep FQCN on conflict last name on TernaryToNullC…
…oalescingRector (#5251) * [AutoImport][Renaming] Keep FQCN on conflict last name on TernaryToNullCoalescingRector * no namespace only * add namespaced fixture * more failing fixture * Fixed 🎉 * comment for future
- Loading branch information
1 parent
5647e1b
commit 03de970
Showing
5 changed files
with
112 additions
and
1 deletion.
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
37 changes: 37 additions & 0 deletions
37
tests/Issues/AutoImport/Fixture/namespaced_after_ternary_to_null_coalesce.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,37 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use shop\product\business\ProductFilter; | ||
|
||
class NamespacedAfterTernaryToNullCoalesce | ||
{ | ||
private function sharedProductFilter(): void | ||
{ | ||
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; | ||
|
||
$this->brands = Hersteller::getListForProducts(new \ProductFilter()); | ||
} | ||
|
||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace App; | ||
|
||
use shop\product\business\ProductFilter; | ||
|
||
class NamespacedAfterTernaryToNullCoalesce | ||
{ | ||
private function sharedProductFilter(): void | ||
{ | ||
$page = $_REQUEST['page'] ?? 1; | ||
|
||
$this->brands = Hersteller::getListForProducts(new \ProductFilter()); | ||
} | ||
|
||
} | ||
|
||
?> |
33 changes: 33 additions & 0 deletions
33
tests/Issues/AutoImport/Fixture/no_namespace_after_ternary_to_null_coalesce.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 | ||
|
||
use shop\product\business\ProductFilter; | ||
|
||
class NoNamespaceAfterTernaryToNullCoalesce | ||
{ | ||
private function sharedProductFilter(): void | ||
{ | ||
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; | ||
|
||
$this->brands = Hersteller::getListForProducts(new \ProductFilter()); | ||
} | ||
|
||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
use shop\product\business\ProductFilter; | ||
|
||
class NoNamespaceAfterTernaryToNullCoalesce | ||
{ | ||
private function sharedProductFilter(): void | ||
{ | ||
$page = $_REQUEST['page'] ?? 1; | ||
|
||
$this->brands = Hersteller::getListForProducts(new \ProductFilter()); | ||
} | ||
|
||
} | ||
|
||
?> |
33 changes: 33 additions & 0 deletions
33
...s/Issues/AutoImport/Fixture/no_namespace_after_ternary_to_null_coalesce_long_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,33 @@ | ||
<?php | ||
|
||
use shop\product\business\ProductFilter; | ||
|
||
class NoNamespaceAfterTernaryToNullCoalesceLongName | ||
{ | ||
private function sharedProductFilter(): void | ||
{ | ||
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; | ||
|
||
$this->brands = Hersteller::getListForProducts(new \some\different\ProductFilter()); | ||
} | ||
|
||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
use shop\product\business\ProductFilter; | ||
|
||
class NoNamespaceAfterTernaryToNullCoalesceLongName | ||
{ | ||
private function sharedProductFilter(): void | ||
{ | ||
$page = $_REQUEST['page'] ?? 1; | ||
|
||
$this->brands = Hersteller::getListForProducts(new \some\different\ProductFilter()); | ||
} | ||
|
||
} | ||
|
||
?> |
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