move FunctionToStaticMethodRector to Transform (#5613)

This commit is contained in:
Tomas Votruba 2021-02-18 22:35:10 +01:00 committed by GitHub
parent cfd0b526d2
commit 19810c2b9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 11 deletions

View File

@ -7565,7 +7565,7 @@ Change singleton class to normal class that can be registered as a service
Change functions to static calls, so composer can autoload them
- class: `Rector\Legacy\Rector\FileWithoutNamespace\FunctionToStaticMethodRector`
- class: `Rector\Transform\Rector\FileWithoutNamespace\FunctionToStaticMethodRector`
```diff
-function some_function()

View File

@ -61,7 +61,9 @@ foreach ($items as $item) {
return false;
CODE_SAMPLE
,
'in_array("something", $items, true);'
<<<'CODE_SAMPLE'
return in_array('something', $items, true);
CODE_SAMPLE
),
]
);

View File

@ -60,7 +60,7 @@ final class SomeClass
{
private $value;
public function __construct($value)
public function __construct(stdClass $value)
{
$this->value = $value;
}
@ -79,7 +79,7 @@ final class SomeClass
{
private $value;
public function __construct($value)
public function __construct(stdClass $value)
{
$this->value = $value;
}

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Rector\Legacy\Rector\FileWithoutNamespace;
namespace Rector\Transform\Rector\FileWithoutNamespace;
use PhpParser\Node;
use PhpParser\Node\Expr\FuncCall;
@ -22,7 +22,7 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use Symplify\SmartFileSystem\SmartFileInfo;
/**
* @see \Rector\Legacy\Tests\Rector\FileWithoutNamespace\FunctionToStaticMethodRector\FunctionToStaticMethodRectorTest
* @see \Rector\Transform\Tests\Rector\FileWithoutNamespace\FunctionToStaticMethodRector\FunctionToStaticMethodRectorTest
*/
final class FunctionToStaticMethodRector extends AbstractRector
{

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Rector\Legacy\Tests\Rector\FileWithoutNamespace\FunctionToStaticMethodRector\Fixture;
namespace Rector\Transform\Tests\Rector\FileWithoutNamespace\FunctionToStaticMethodRector\Fixture;
function first_static_function()
{
@ -17,7 +17,7 @@ $value = first_static_function();
declare(strict_types=1);
namespace Rector\Legacy\Tests\Rector\FileWithoutNamespace\FunctionToStaticMethodRector\Fixture;
namespace Rector\Transform\Tests\Rector\FileWithoutNamespace\FunctionToStaticMethodRector\Fixture;
$value = %sStaticFunctions::firstStaticFunction();

View File

@ -2,11 +2,11 @@
declare(strict_types=1);
namespace Rector\Legacy\Tests\Rector\FileWithoutNamespace\FunctionToStaticMethodRector;
namespace Rector\Transform\Tests\Rector\FileWithoutNamespace\FunctionToStaticMethodRector;
use Iterator;
use Rector\Legacy\Rector\FileWithoutNamespace\FunctionToStaticMethodRector;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Rector\Transform\Rector\FileWithoutNamespace\FunctionToStaticMethodRector;
use Symplify\SmartFileSystem\SmartFileInfo;
final class FunctionToStaticMethodRectorTest extends AbstractRectorTestCase

View File

@ -1,6 +1,6 @@
<?php
namespace Rector\Legacy\Tests\Rector\FileWithoutNamespace\FunctionToStaticMethodRector\Fixture;
namespace Rector\Transform\Tests\Rector\FileWithoutNamespace\FunctionToStaticMethodRector\Fixture;
final class StaticFunctions
{