-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test case with union partials (#1147)
- Loading branch information
1 parent
78f7f0d
commit 3706416
Showing
4 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...-tests/CodingStyle/ClassNameImport/ShortNameResolver/Fixture/union_partial_import.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,19 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\ClassNameImport\ShortNameResolver\Fixture; | ||
|
||
use Rector\Tests\CodingStyle\ClassNameImport\ShortNameResolver\Source; | ||
use Rector\Tests\CodingStyle\ClassNameImport\ShortNameResolver\Source\FirstLog; | ||
use Rector\Tests\CodingStyle\ClassNameImport\ShortNameResolver\Source\SecondLog; | ||
|
||
final class UnionPartialImport | ||
{ | ||
public function run(): Source\FirstLog|Source\SecondLog | ||
{ | ||
if (rand(0, 1)) { | ||
return new FirstLog(); | ||
} | ||
|
||
return new SecondLog(); | ||
} | ||
} |
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
10 changes: 10 additions & 0 deletions
10
rules-tests/CodingStyle/ClassNameImport/ShortNameResolver/Source/FirstLog.php
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,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\CodingStyle\ClassNameImport\ShortNameResolver\Source; | ||
|
||
final class FirstLog | ||
{ | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
rules-tests/CodingStyle/ClassNameImport/ShortNameResolver/Source/SecondLog.php
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,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\CodingStyle\ClassNameImport\ShortNameResolver\Source; | ||
|
||
final class SecondLog | ||
{ | ||
|
||
} |