-
-
Notifications
You must be signed in to change notification settings - Fork 684
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing stmt on adding a new node (#6383)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
- Loading branch information
1 parent
20f9bb7
commit b1b5f95
Showing
7 changed files
with
204 additions
and
5 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Core\Tests\Issues; | ||
|
||
use Iterator; | ||
use Rector\Testing\PHPUnit\AbstractRectorTestCase; | ||
use Symplify\SmartFileSystem\SmartFileInfo; | ||
|
||
final class CovariantTrioTest extends AbstractRectorTestCase | ||
{ | ||
/** | ||
* @dataProvider provideData() | ||
*/ | ||
public function test(SmartFileInfo $fileInfo): void | ||
{ | ||
$this->doTestFileInfo($fileInfo); | ||
} | ||
|
||
/** | ||
* @return Iterator<SmartFileInfo> | ||
*/ | ||
public function provideData(): Iterator | ||
{ | ||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); | ||
} | ||
|
||
public function provideConfigFilePath(): string | ||
{ | ||
return __DIR__ . '/config/covariant_trio.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,33 @@ | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\Fixture; | ||
|
||
final class CoriantMixture | ||
{ | ||
private function parseArgument(string $token, array $all) | ||
{ | ||
if (($inputArgument = $all[$key = array_key_first($all)] ?? null) && 'command' === $inputArgument->getName()) { | ||
} | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\Fixture; | ||
|
||
final class CoriantMixture | ||
{ | ||
/** | ||
* @param string $token | ||
*/ | ||
private function parseArgument($token, array $all) | ||
{ | ||
reset($all); | ||
if (($inputArgument = isset($all[$key = key($all)]) ? $all[$key = key($all)] : null) && 'command' === $inputArgument->getName()) { | ||
} | ||
} | ||
} | ||
|
||
?> |
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,94 @@ | ||
<?php | ||
|
||
class ArgvInput extends Input | ||
{ | ||
/** | ||
* Parses an argument. | ||
* | ||
* @throws RuntimeException When too many arguments are given | ||
*/ | ||
private function parseArgument(string $token, array $all) | ||
{ | ||
if (($inputArgument = $all[$key = array_key_first($all)] ?? null) && 'command' === $inputArgument->getName()) { | ||
} | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function hasParameterOption($values, bool $onlyParams = false) | ||
{ | ||
} | ||
} | ||
|
||
abstract class Input implements InputInterface | ||
{ | ||
|
||
} | ||
|
||
class ArrayInput extends Input | ||
{ | ||
public function hasParameterOption($values, bool $onlyParams = false) | ||
{ | ||
|
||
} | ||
} | ||
|
||
interface InputInterface | ||
{ | ||
public function hasParameterOption($values, bool $onlyParams = false); | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
class ArgvInput extends Input | ||
{ | ||
/** | ||
* Parses an argument. | ||
* | ||
* @throws RuntimeException When too many arguments are given | ||
* @param string $token | ||
*/ | ||
private function parseArgument($token, array $all) | ||
{ | ||
reset($all); | ||
if (($inputArgument = isset($all[$key = key($all)]) ? $all[$key = key($all)] : null) && 'command' === $inputArgument->getName()) { | ||
} | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
* @param bool $onlyParams | ||
*/ | ||
public function hasParameterOption($values, $onlyParams = false) | ||
{ | ||
} | ||
} | ||
|
||
abstract class Input implements InputInterface | ||
{ | ||
|
||
} | ||
|
||
class ArrayInput extends Input | ||
{ | ||
/** | ||
* @param bool $onlyParams | ||
*/ | ||
public function hasParameterOption($values, $onlyParams = false) | ||
{ | ||
|
||
} | ||
} | ||
|
||
interface InputInterface | ||
{ | ||
/** | ||
* @param bool $onlyParams | ||
*/ | ||
public function hasParameterOption($values, $onlyParams = false); | ||
} | ||
|
||
?> |
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,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Core\Configuration\Option; | ||
use Rector\Core\ValueObject\PhpVersion; | ||
use Rector\DowngradePhp70\Rector\Coalesce\DowngradeNullCoalesceRector; | ||
use Rector\DowngradePhp70\Rector\FunctionLike\DowngradeTypeDeclarationRector; | ||
use Rector\DowngradePhp73\Rector\FuncCall\DowngradeArrayKeyFirstLastRector; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$parameters = $containerConfigurator->parameters(); | ||
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_70); | ||
|
||
$services = $containerConfigurator->services(); | ||
$services->set(DowngradeArrayKeyFirstLastRector::class); | ||
$services->set(DowngradeTypeDeclarationRector::class); | ||
$services->set(DowngradeNullCoalesceRector::class); | ||
}; |