mirror of
https://github.com/rectorphp/rector.git
synced 2024-07-30 21:30:23 +00:00
add PHP Rectors to own groups
This commit is contained in:
parent
b866ff9461
commit
2a1fffc443
@ -179,8 +179,8 @@
|
||||
"packages/PhpParser/tests/Rector/SetLineRector/Wrong",
|
||||
"packages/CakePHP/tests/Rector/MethodCall/ModalToGetSetRector/Wrong",
|
||||
"packages/Sensio/tests/Rector/FrameworkExtraBundle/TemplateAnnotationRector/Wrong",
|
||||
"packages/Php/tests/Rector/TypedPropertyRector/Wrong",
|
||||
"packages/Php/tests/Rector/ExceptionHandlerTypehintRector/Wrong"
|
||||
"packages/Php/tests/Rector/Property/TypedPropertyRector/Wrong",
|
||||
"packages/Php/tests/Rector/FunctionLike/ExceptionHandlerTypehintRector/Wrong"
|
||||
],
|
||||
"files": [
|
||||
"tests/Rector/Psr4/MultipleClassFileToPsr4ClassesRector/Source/exceptions.php",
|
||||
|
@ -1,2 +1,2 @@
|
||||
services:
|
||||
Rector\Php\Rector\TypedPropertyRector: ~
|
||||
Rector\Php\Rector\Property\TypedPropertyRector: ~
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Rector;
|
||||
namespace Rector\Php\Rector\BinaryOp;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\BinaryOp\BooleanOr;
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Rector;
|
||||
namespace Rector\Php\Rector\BinaryOp;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\BinaryOp\BooleanOr;
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Rector;
|
||||
namespace Rector\Php\Rector\ClassConst;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Stmt\Class_;
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Rector;
|
||||
namespace Rector\Php\Rector\FuncCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\BinaryOp\Pow;
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Rector;
|
||||
namespace Rector\Php\Rector\FuncCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Arg;
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Rector;
|
||||
namespace Rector\Php\Rector\FunctionLike;
|
||||
|
||||
use Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Rector;
|
||||
namespace Rector\Php\Rector\Property;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\Array_;
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Rector;
|
||||
namespace Rector\Php\Rector\Ternary;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\BinaryOp\Coalesce;
|
@ -1,12 +1,12 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\IsCountableRector;
|
||||
namespace Rector\Php\Tests\Rector\BinaryOp\IsCountableRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Rector\Php\Rector\IsCountableRector
|
||||
* @covers \Rector\Php\Rector\BinaryOp\IsCountableRector
|
||||
*/
|
||||
final class IsCountableRectorTest extends AbstractRectorTestCase
|
||||
{
|
@ -0,0 +1,2 @@
|
||||
services:
|
||||
Rector\Php\Rector\BinaryOp\IsCountableRector: ~
|
@ -1,12 +1,12 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\IsIterableRector;
|
||||
namespace Rector\Php\Tests\Rector\BinaryOp\IsIterableRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Rector\Php\Rector\IsIterableRector
|
||||
* @covers \Rector\Php\Rector\BinaryOp\IsIterableRector
|
||||
*/
|
||||
final class IsIterableRectorTest extends AbstractRectorTestCase
|
||||
{
|
@ -0,0 +1,2 @@
|
||||
services:
|
||||
Rector\Php\Rector\BinaryOp\IsIterableRector: ~
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\PublicConstantVisibilityRector\Wrong;
|
||||
namespace Rector\Php\Tests\Rector\ClassConst\PublicConstantVisibilityRector\Wrong;
|
||||
|
||||
final class SomeClass
|
||||
{
|
@ -1,12 +1,12 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\PublicConstantVisibilityRector;
|
||||
namespace Rector\Php\Tests\Rector\ClassConst\PublicConstantVisibilityRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Rector\Php\Rector\PublicConstantVisibilityRector
|
||||
* @covers \Rector\Php\Rector\ClassConst\PublicConstantVisibilityRector
|
||||
*/
|
||||
final class PublicConstantVisibilityRectorTest extends AbstractRectorTestCase
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\PublicConstantVisibilityRector\Wrong;
|
||||
namespace Rector\Php\Tests\Rector\ClassConst\PublicConstantVisibilityRector\Wrong;
|
||||
|
||||
final class SomeClass
|
||||
{
|
@ -0,0 +1,2 @@
|
||||
services:
|
||||
Rector\Php\Rector\ClassConst\PublicConstantVisibilityRector: ~
|
@ -1,2 +0,0 @@
|
||||
services:
|
||||
Rector\Php\Rector\ExceptionHandlerTypehintRector: ~
|
@ -1,12 +1,12 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\PowToExpRector;
|
||||
namespace Rector\Php\Tests\Rector\FuncCall\PowToExpRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Rector\Php\Rector\PowToExpRector
|
||||
* @covers \Rector\Php\Rector\FuncCall\PowToExpRector
|
||||
*
|
||||
* Some tests copied from:
|
||||
* - https://github.com/FriendsOfPHP/PHP-CS-Fixer/commit/14660432d9d0b66bf65135d793b52872cc6eccbc#diff-b412676c923661ef450f4a0903c5442a
|
@ -0,0 +1,2 @@
|
||||
services:
|
||||
Rector\Php\Rector\FuncCall\PowToExpRector: ~
|
@ -1,12 +1,12 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\RandomFunctionRector;
|
||||
namespace Rector\Php\Tests\Rector\FuncCall\RandomFunctionRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Rector\Php\Rector\RandomFunctionRector
|
||||
* @covers \Rector\Php\Rector\FuncCall\RandomFunctionRector
|
||||
*
|
||||
* Some tests copied from https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/2.12/tests/Fixer/Alias/RandomApiMigrationFixerTest.php
|
||||
*/
|
@ -0,0 +1,2 @@
|
||||
services:
|
||||
Rector\Php\Rector\FuncCall\RandomFunctionRector: ~
|
@ -1,12 +1,12 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\ExceptionHandlerTypehintRector;
|
||||
namespace Rector\Php\Tests\Rector\FunctionLike\ExceptionHandlerTypehintRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Rector\Php\Rector\ExceptionHandlerTypehintRector
|
||||
* @covers \Rector\Php\Rector\FunctionLike\ExceptionHandlerTypehintRector
|
||||
*/
|
||||
final class ExceptionHandlerTypehintRectorTest extends AbstractRectorTestCase
|
||||
{
|
@ -0,0 +1,2 @@
|
||||
services:
|
||||
Rector\Php\Rector\FunctionLike\ExceptionHandlerTypehintRector: ~
|
@ -1,2 +0,0 @@
|
||||
services:
|
||||
Rector\Php\Rector\IsCountableRector: ~
|
@ -1,2 +0,0 @@
|
||||
services:
|
||||
Rector\Php\Rector\IsIterableRector: ~
|
@ -1,2 +0,0 @@
|
||||
services:
|
||||
Rector\Php\Rector\PowToExpRector: ~
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TypedPropertyRector\Wrong;
|
||||
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector\Wrong;
|
||||
|
||||
final class ClassWithProperty
|
||||
{
|
@ -0,0 +1,10 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector\Wrong;
|
||||
|
||||
use Rector\Php\Tests\Rector\Property\TypedPropertyRector\Source\AnotherClass;
|
||||
|
||||
final class ClassWithClassProperty
|
||||
{
|
||||
private AnotherClass $anotherClass;
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TypedPropertyRector\Wrong;
|
||||
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector\Wrong;
|
||||
|
||||
use Rector\Php\Tests\Rector\TypedPropertyRector\Source\AnotherClass;
|
||||
use Rector\Php\Tests\Rector\Property\TypedPropertyRector\Source\AnotherClass;
|
||||
|
||||
final class ClassWithNullableProperty
|
||||
{
|
@ -0,0 +1,10 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector\Wrong;
|
||||
|
||||
use Rector\Php\Tests\Rector\Property\TypedPropertyRector\Source\AnotherClass;
|
||||
|
||||
final class ClassWithStaticProperty
|
||||
{
|
||||
private static iterable $iterable;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TypedPropertyRector\Wrong;
|
||||
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector\Wrong;
|
||||
|
||||
final class DefaultValues
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TypedPropertyRector\Wrong;
|
||||
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector\Wrong;
|
||||
|
||||
final class MatchTypes
|
||||
{
|
@ -0,0 +1,8 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector\Source;
|
||||
|
||||
final class AnotherClass
|
||||
{
|
||||
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TypedPropertyRector;
|
||||
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Rector\Php\Rector\TypedPropertyRector
|
||||
* @covers \Rector\Php\Rector\Property\TypedPropertyRector
|
||||
*/
|
||||
final class TypedPropertyRectorTest extends AbstractRectorTestCase
|
||||
{
|
@ -0,0 +1,13 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector\Wrong;
|
||||
|
||||
use Rector\Php\Tests\Rector\Property\TypedPropertyRector\Source\AnotherClass;
|
||||
|
||||
final class ClassWithClassProperty
|
||||
{
|
||||
/**
|
||||
* @var AnotherClass
|
||||
*/
|
||||
private $anotherClass;
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TypedPropertyRector\Wrong;
|
||||
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector\Wrong;
|
||||
|
||||
use Rector\Php\Tests\Rector\TypedPropertyRector\Source\AnotherClass;
|
||||
use Rector\Php\Tests\Rector\Property\TypedPropertyRector\Source\AnotherClass;
|
||||
|
||||
final class ClassWithNullableProperty
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TypedPropertyRector\Wrong;
|
||||
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector\Wrong;
|
||||
|
||||
final class ClassWithProperty
|
||||
{
|
@ -0,0 +1,13 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector\Wrong;
|
||||
|
||||
use Rector\Php\Tests\Rector\Property\TypedPropertyRector\Source\AnotherClass;
|
||||
|
||||
final class ClassWithStaticProperty
|
||||
{
|
||||
/**
|
||||
* @var iterable
|
||||
*/
|
||||
private static $iterable;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TypedPropertyRector\Wrong;
|
||||
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector\Wrong;
|
||||
|
||||
final class DefaultValues
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TypedPropertyRector\Wrong;
|
||||
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector\Wrong;
|
||||
|
||||
final class MatchTypes
|
||||
{
|
@ -0,0 +1,2 @@
|
||||
services:
|
||||
Rector\Php\Rector\Property\TypedPropertyRector: ~
|
@ -1,2 +0,0 @@
|
||||
services:
|
||||
Rector\Php\Rector\PublicConstantVisibilityRector: ~
|
@ -1,2 +0,0 @@
|
||||
services:
|
||||
Rector\Php\Rector\RandomFunctionRector: ~
|
@ -1,12 +1,12 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TernaryToNullCoalescingRector;
|
||||
namespace Rector\Php\Tests\Rector\Ternary\TernaryToNullCoalescingRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Rector\Php\Rector\TernaryToNullCoalescingRector
|
||||
* @covers \Rector\Php\Rector\Ternary\TernaryToNullCoalescingRector
|
||||
*
|
||||
* Some tests copied from:
|
||||
* https://github.com/FriendsOfPHP/PHP-CS-Fixer/commit/0db4f91088a3888a7c8b26e5a36fba53c0d9507c#diff-02f477b178d0dc5b25ac05ab3b59e7c7
|
@ -0,0 +1,2 @@
|
||||
services:
|
||||
Rector\Php\Rector\Ternary\TernaryToNullCoalescingRector: ~
|
@ -1,2 +0,0 @@
|
||||
services:
|
||||
Rector\Php\Rector\TernaryToNullCoalescingRector: ~
|
@ -1,10 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TypedPropertyRector\Wrong;
|
||||
|
||||
use Rector\Php\Tests\Rector\TypedPropertyRector\Source\AnotherClass;
|
||||
|
||||
final class ClassWithClassProperty
|
||||
{
|
||||
private AnotherClass $anotherClass;
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TypedPropertyRector\Wrong;
|
||||
|
||||
use Rector\Php\Tests\Rector\TypedPropertyRector\Source\AnotherClass;
|
||||
|
||||
final class ClassWithStaticProperty
|
||||
{
|
||||
private static iterable $iterable;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TypedPropertyRector\Source;
|
||||
|
||||
final class AnotherClass
|
||||
{
|
||||
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TypedPropertyRector\Wrong;
|
||||
|
||||
use Rector\Php\Tests\Rector\TypedPropertyRector\Source\AnotherClass;
|
||||
|
||||
final class ClassWithClassProperty
|
||||
{
|
||||
/**
|
||||
* @var AnotherClass
|
||||
*/
|
||||
private $anotherClass;
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php\Tests\Rector\TypedPropertyRector\Wrong;
|
||||
|
||||
use Rector\Php\Tests\Rector\TypedPropertyRector\Source\AnotherClass;
|
||||
|
||||
final class ClassWithStaticProperty
|
||||
{
|
||||
/**
|
||||
* @var iterable
|
||||
*/
|
||||
private static $iterable;
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
services:
|
||||
Rector\Php\Rector\TypedPropertyRector: ~
|
@ -7,7 +7,7 @@ use PhpParser\Node\Stmt\Expression;
|
||||
use PhpParser\Node\Stmt\Property;
|
||||
use PhpParser\PrettyPrinter\Standard;
|
||||
use Rector\NodeTypeResolver\Node\Attribute;
|
||||
use Rector\Php\Rector\TypedPropertyRector;
|
||||
use Rector\Php\Rector\Property\TypedPropertyRector;
|
||||
use function Safe\sprintf;
|
||||
|
||||
final class BetterStandardPrinter extends Standard
|
||||
|
Loading…
Reference in New Issue
Block a user