-
-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AutoImport] Add mirror comment support on first Use_ on no namespace…
… code (#3465)
- Loading branch information
1 parent
ed5caee
commit 291aab4
Showing
4 changed files
with
156 additions
and
12 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
43 changes: 43 additions & 0 deletions
43
tests/Issues/AutoImportBeforeDocblock/Fixture/no_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,43 @@ | ||
<?php | ||
|
||
/** | ||
* License | ||
*/ | ||
|
||
use Foobar\A; | ||
|
||
/** | ||
* Docblock | ||
*/ | ||
final class NoNamespace | ||
{ | ||
public function run() | ||
{ | ||
new A(); | ||
new \Foobar\B(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
/** | ||
* License | ||
*/ | ||
use Foobar\B; | ||
use Foobar\A; | ||
|
||
/** | ||
* Docblock | ||
*/ | ||
final class NoNamespace | ||
{ | ||
public function run() | ||
{ | ||
new A(); | ||
new B(); | ||
} | ||
} | ||
|
||
?> |
47 changes: 47 additions & 0 deletions
47
tests/Issues/AutoImportBeforeDocblock/Fixture/no_namespace_with_strict_types.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,47 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* License | ||
*/ | ||
|
||
use Foobar\A; | ||
|
||
/** | ||
* Docblock | ||
*/ | ||
final class NoNamespaceWithStrictTypes | ||
{ | ||
public function run() | ||
{ | ||
new A(); | ||
new \Foobar\B(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* License | ||
*/ | ||
use Foobar\B; | ||
|
||
use Foobar\A; | ||
|
||
/** | ||
* Docblock | ||
*/ | ||
final class NoNamespaceWithStrictTypes | ||
{ | ||
public function run() | ||
{ | ||
new A(); | ||
new B(); | ||
} | ||
} | ||
|
||
?> |
37 changes: 37 additions & 0 deletions
37
...s/AutoImportBeforeDocblock/Fixture/no_namespace_with_strict_types_no_existing_use.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 | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Docblock | ||
*/ | ||
final class NoNamespaceWithStrictTypesNoExistingUse | ||
{ | ||
public function run() | ||
{ | ||
new A(); | ||
new \Foobar\B(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Foobar\B; | ||
|
||
/** | ||
* Docblock | ||
*/ | ||
final class NoNamespaceWithStrictTypesNoExistingUse | ||
{ | ||
public function run() | ||
{ | ||
new A(); | ||
new B(); | ||
} | ||
} | ||
|
||
?> |