-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AutoImport] Do not add cast on valid Integer type on aliased Name No…
…de on auto import enabled (#6237) * [AutoImport] Do not add cast on valid Integer type on aliased Name Node on auto import enabled * Fix * Fix
- Loading branch information
1 parent
174adf1
commit 54bf439
Showing
3 changed files
with
49 additions
and
0 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
41 changes: 41 additions & 0 deletions
41
tests/Issues/AutoImport/Fixture/do_not_add_cast_valid_int_type_from_name_aliased.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,41 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Issues\AutoImport\Fixture; | ||
|
||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use Rector\Tests\Issues\AutoImport\Source\SomeClass as SomeClass1; | ||
use Fixture\SomeClass; | ||
|
||
class DoNotAddCastValidIntTypeFromNameAliased extends Command | ||
{ | ||
private ?OutputInterface $outputInterface = null; | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output): int | ||
{ | ||
return \Rector\Tests\Issues\AutoImport\Source\SomeClass::zero(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Issues\AutoImport\Fixture; | ||
|
||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use Rector\Tests\Issues\AutoImport\Source\SomeClass as SomeClass1; | ||
use Fixture\SomeClass; | ||
|
||
class DoNotAddCastValidIntTypeFromNameAliased extends Command | ||
{ | ||
protected function execute(InputInterface $input, OutputInterface $output): int | ||
{ | ||
return SomeClass1::zero(); | ||
} | ||
} | ||
|
||
?> |