-
-
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] Skip multiple namespaces on single file on auto imports (#…
…2940) * [AutoImport] Skip multiple namespaces on auto imports * more fixture * more fixture * skip multiple namespaces
- Loading branch information
1 parent
cd1dca7
commit 4c69331
Showing
6 changed files
with
75 additions
and
43 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
42 changes: 0 additions & 42 deletions
42
...ngStyle/Rector/Namespace_/ImportFullyQualifiedNamesRector/Fixture/bootstrap_names.php.inc
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
...ector/Namespace_/ImportFullyQualifiedNamesRector/Fixture/skip_multiple_namespaces.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,18 @@ | ||
<?php | ||
|
||
namespace { | ||
function run_me_never() | ||
{ | ||
// silent deprecations, since we test them | ||
error_reporting(E_ALL ^ E_DEPRECATED); | ||
|
||
// performance boost | ||
\SomeNamespace\gc_disable(); | ||
} | ||
} | ||
|
||
namespace SomeNamespace | ||
{ | ||
function gc_disable() | ||
{} | ||
} |
15 changes: 15 additions & 0 deletions
15
...ssues/AutoImportGroupUse/Fixture/skip_multiple_namespaces_auto_import_in_groupuse.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,15 @@ | ||
<?php | ||
|
||
namespace A { | ||
use Rector\Core\Tests\Issues\AutoImportGroupUse\Source\{ SomeClass }; | ||
|
||
final class AutoImportInGroupUse extends \Rector\Core\Tests\Issues\AutoImportGroupUse\Source\SomeClass | ||
{ | ||
} | ||
} | ||
|
||
namespace B { | ||
final class AutoImportInGroupUse extends \Rector\Core\Tests\Issues\AutoImportGroupUse\Source\SomeClass | ||
{ | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/Issues/AutoImportInAlias/Fixture/skip_multiple_namespace.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,15 @@ | ||
<?php | ||
|
||
namespace C { | ||
use stdClass; | ||
|
||
final class AutoImport extends \stdClass | ||
{ | ||
} | ||
} | ||
|
||
namespace D { | ||
final class AutoImport extends \stdClass | ||
{ | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/Issues/AutoImportInAlias/Fixture/skip_multiple_namespace_with_alias.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,15 @@ | ||
<?php | ||
|
||
namespace A { | ||
use stdClass as SomeObject; | ||
|
||
final class AutoImportInAlias extends \stdClass | ||
{ | ||
} | ||
} | ||
|
||
namespace B { | ||
final class AutoImportInAlias extends \stdClass | ||
{ | ||
} | ||
} |