Skip to content

Commit

Permalink
[ci-review] Rector Rectify
Browse files Browse the repository at this point in the history
  • Loading branch information
rector-bot committed Jan 27, 2021
1 parent 339c784 commit c438b98
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
namespace Rector\Transform\Rector\StaticCall;

use PhpParser\Node;
use PhpParser\Node\Expr\New_;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Name\FullyQualified;
use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
use Rector\Core\Rector\AbstractRector;
Expand Down Expand Up @@ -65,7 +67,7 @@ public function run()
*/
public function getNodeTypes(): array
{
return [Node\Expr\StaticCall::class];
return [StaticCall::class];
}

/**
Expand All @@ -87,7 +89,7 @@ public function refactor(Node $node): ?Node
continue;
}

return new Node\Expr\New_(new FullyQualified($class));
return new New_(new FullyQualified($class));
}

return $node;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@

namespace Rector\Transform\Tests\Rector\New_\NewArgToMethodCallRector;

use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Rector\Transform\Rector\New_\NewArgToMethodCallRector;
use Rector\Transform\Tests\Rector\New_\NewArgToMethodCallRector\Source\SomeDotenv;
use Rector\Transform\ValueObject\NewArgToMethodCall;
use Symplify\SmartFileSystem\SmartFileInfo;

final class NewArgToMethodCallRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideData()
*/
public function test(\Symplify\SmartFileSystem\SmartFileInfo $fileInfo): void
public function test(SmartFileInfo $fileInfo): void
{
$this->doTestFileInfo($fileInfo);
}

public function provideData(): \Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@

namespace Rector\Transform\Tests\Rector\StaticCall\StaticCallToNewRector;

use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Rector\Transform\Rector\StaticCall\StaticCallToNewRector;
use Rector\Transform\Tests\Rector\StaticCall\StaticCallToNewRector\Source\SomeJsonResponse;
use Symplify\SmartFileSystem\SmartFileInfo;

final class StaticCallToNewRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideData()
*/
public function test(\Symplify\SmartFileSystem\SmartFileInfo $fileInfo): void
public function test(SmartFileInfo $fileInfo): void
{
$this->doTestFileInfo($fileInfo);
}

public function provideData(): \Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand All @@ -28,9 +31,9 @@ public function provideData(): \Iterator
protected function getRectorsWithConfiguration(): array
{
return [
\Rector\Transform\Rector\StaticCall\StaticCallToNewRector::class =>
StaticCallToNewRector::class =>
[
\Rector\Transform\Rector\StaticCall\StaticCallToNewRector::STATIC_CALLS_TO_NEWS => [
StaticCallToNewRector::STATIC_CALLS_TO_NEWS => [
SomeJsonResponse::class => 'create',
],
],
Expand Down

0 comments on commit c438b98

Please sign in to comment.