mirror of
https://github.com/rectorphp/rector.git
synced 2024-09-04 22:52:16 +00:00
Fix type widening command (#5883)
* skip parent type for construtc * skip magic method
This commit is contained in:
parent
0e383192ae
commit
6ad6bdc2d7
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Tests\DowngradePhp72\Rector\ClassMethod\DowngradeParameterTypeWideningRector\Fixture;
|
||||
|
||||
use Rector\Tests\DowngradePhp72\Rector\ClassMethod\DowngradeParameterTypeWideningRector\Source\AnyService;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
|
||||
final class SkipCommand extends Command
|
||||
{
|
||||
/**
|
||||
* @var AnyService
|
||||
*/
|
||||
private $anyService;
|
||||
|
||||
public function __construct(AnyService $anyService)
|
||||
{
|
||||
$this->anyService = $anyService;
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Tests\DowngradePhp72\Rector\ClassMethod\DowngradeParameterTypeWideningRector\Source;
|
||||
|
||||
final class AnyService
|
||||
{
|
||||
|
||||
}
|
@ -98,6 +98,10 @@ CODE_SAMPLE
|
||||
*/
|
||||
public function refactor(Node $node): ?Node
|
||||
{
|
||||
if ($node->isMagic()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($node->params === []) {
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user