add PHP Rectors to own groups

This commit is contained in:
Tomas Votruba 2018-10-05 17:05:03 +08:00
parent b866ff9461
commit 2a1fffc443
73 changed files with 110 additions and 110 deletions

View File

@ -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",

View File

@ -1,2 +1,2 @@
services:
Rector\Php\Rector\TypedPropertyRector: ~
Rector\Php\Rector\Property\TypedPropertyRector: ~

View File

@ -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;

View File

@ -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;

View File

@ -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_;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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_;

View File

@ -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;

View File

@ -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
{

View File

@ -0,0 +1,2 @@
services:
Rector\Php\Rector\BinaryOp\IsCountableRector: ~

View File

@ -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
{

View File

@ -0,0 +1,2 @@
services:
Rector\Php\Rector\BinaryOp\IsIterableRector: ~

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -0,0 +1,2 @@
services:
Rector\Php\Rector\ClassConst\PublicConstantVisibilityRector: ~

View File

@ -1,2 +0,0 @@
services:
Rector\Php\Rector\ExceptionHandlerTypehintRector: ~

View File

@ -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

View File

@ -0,0 +1,2 @@
services:
Rector\Php\Rector\FuncCall\PowToExpRector: ~

View File

@ -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
*/

View File

@ -0,0 +1,2 @@
services:
Rector\Php\Rector\FuncCall\RandomFunctionRector: ~

View File

@ -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
{

View File

@ -0,0 +1,2 @@
services:
Rector\Php\Rector\FunctionLike\ExceptionHandlerTypehintRector: ~

View File

@ -1,2 +0,0 @@
services:
Rector\Php\Rector\IsCountableRector: ~

View File

@ -1,2 +0,0 @@
services:
Rector\Php\Rector\IsIterableRector: ~

View File

@ -1,2 +0,0 @@
services:
Rector\Php\Rector\PowToExpRector: ~

View File

@ -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
{

View File

@ -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;
}

View File

@ -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
{

View File

@ -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;
}

View File

@ -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
{

View File

@ -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
{

View File

@ -0,0 +1,8 @@
<?php declare(strict_types=1);
namespace Rector\Php\Tests\Rector\Property\TypedPropertyRector\Source;
final class AnotherClass
{
}

View File

@ -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
{

View File

@ -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;
}

View File

@ -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
{

View File

@ -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
{

View File

@ -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;
}

View File

@ -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
{

View File

@ -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
{

View File

@ -0,0 +1,2 @@
services:
Rector\Php\Rector\Property\TypedPropertyRector: ~

View File

@ -1,2 +0,0 @@
services:
Rector\Php\Rector\PublicConstantVisibilityRector: ~

View File

@ -1,2 +0,0 @@
services:
Rector\Php\Rector\RandomFunctionRector: ~

View File

@ -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

View File

@ -0,0 +1,2 @@
services:
Rector\Php\Rector\Ternary\TernaryToNullCoalescingRector: ~

View File

@ -1,2 +0,0 @@
services:
Rector\Php\Rector\TernaryToNullCoalescingRector: ~

View File

@ -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;
}

View File

@ -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;
}

View File

@ -1,8 +0,0 @@
<?php declare(strict_types=1);
namespace Rector\Php\Tests\Rector\TypedPropertyRector\Source;
final class AnotherClass
{
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -1,2 +0,0 @@
services:
Rector\Php\Rector\TypedPropertyRector: ~

View File

@ -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