move PhpParser Rectors to own package

This commit is contained in:
Tomas Votruba 2018-06-02 13:39:01 +02:00
parent 1c8217daa6
commit 336ffdd7d7
50 changed files with 53 additions and 44 deletions

View File

@ -40,7 +40,8 @@
"Rector\\Sensio\\": "packages/Sensio/src",
"Rector\\Nette\\": "packages/Nette/src",
"Rector\\Sylius\\": "packages/Sylius/src",
"Rector\\PHPUnit\\": "packages/PHPUnit/src"
"Rector\\PHPUnit\\": "packages/PHPUnit/src",
"Rector\\PhpParser\\": "packages/PhpParser/src"
}
},
"autoload-dev": {
@ -54,7 +55,8 @@
"Rector\\Sensio\\Tests\\": "packages/Sensio/tests",
"Rector\\Nette\\Tests\\": "packages/Nette/tests",
"Rector\\Sylius\\Tests\\": "packages/Sylius/tests",
"Rector\\PHPUnit\\Tests\\": "packages/PHPUnit/tests"
"Rector\\PHPUnit\\Tests\\": "packages/PHPUnit/tests",
"Rector\\PhpParser\\Tests\\": "packages/PhpParser/tests"
},
"classmap": [
"packages/Symfony/tests"

View File

@ -1,10 +1,10 @@
services:
Rector\Rector\Contrib\PhpParser\IdentifierRector: ~
Rector\Rector\Contrib\PhpParser\ParamAndStaticVarNameRector: ~
Rector\Rector\Contrib\PhpParser\CatchAndClosureUseNameRector: ~
Rector\Rector\Contrib\PhpParser\SetLineRector: ~
Rector\Rector\Contrib\PhpParser\RemoveNodeRector: ~
Rector\Rector\Contrib\PhpParser\UseWithAliasRector: ~
Rector\PhpParser\Rector\IdentifierRector: ~
Rector\PhpParser\Rector\ParamAndStaticVarNameRector: ~
Rector\PhpParser\Rector\CatchAndClosureUseNameRector: ~
Rector\PhpParser\Rector\SetLineRector: ~
Rector\PhpParser\Rector\RemoveNodeRector: ~
Rector\PhpParser\Rector\UseWithAliasRector: ~
Rector\Rector\Dynamic\PropertyNameReplacerRector:
$perClassOldToNewProperties:

View File

@ -377,7 +377,7 @@ Turns magic callback assign to callback assign on Nette Form events.
+$container->removeService("someKey");
```
## Rector\Rector\Contrib\PhpParser\IdentifierRector
## Rector\PhpParser\Rector\IdentifierRector
Turns node string names to Identifier object in php-parser
@ -387,7 +387,7 @@ Turns node string names to Identifier object in php-parser
+$name = $constNode->name->toString();'
```
## Rector\Rector\Contrib\PhpParser\ParamAndStaticVarNameRector
## Rector\PhpParser\Rector\ParamAndStaticVarNameRector
Turns old string `var` to `var->name` sub-variable in Node of PHP-Parser
@ -399,7 +399,7 @@ Turns old string `var` to `var->name` sub-variable in Node of PHP-Parser
+$staticVarNode->var->name;
```
## Rector\Rector\Contrib\PhpParser\CatchAndClosureUseNameRector
## Rector\PhpParser\Rector\CatchAndClosureUseNameRector
Turns `$catchNode->var` to its new `name` property in php-parser
@ -408,7 +408,7 @@ Turns `$catchNode->var` to its new `name` property in php-parser
+$catchNode->var->name
```
## Rector\Rector\Contrib\PhpParser\SetLineRector
## Rector\PhpParser\Rector\SetLineRector
Turns standalone line method to attribute in Node of PHP-Parser
@ -417,7 +417,7 @@ Turns standalone line method to attribute in Node of PHP-Parser
+$node->setAttribute("line", 5);
```
## Rector\Rector\Contrib\PhpParser\RemoveNodeRector
## Rector\PhpParser\Rector\RemoveNodeRector
Turns integer return to remove node to constant in NodeVisitor of PHP-Parser
@ -429,7 +429,7 @@ Turns integer return to remove node to constant in NodeVisitor of PHP-Parser
}
```
## Rector\Rector\Contrib\PhpParser\UseWithAliasRector
## Rector\PhpParser\Rector\UseWithAliasRector
Turns use property to method and `$node->alias` to last name in UseAlias Node of PHP-Parser

View File

@ -1,6 +1,6 @@
<?php declare(strict_types=1);
namespace Rector\Rector\Contrib\PhpParser;
namespace Rector\PhpParser\Rector;
use PhpParser\Node;
use PhpParser\Node\Expr\PropertyFetch;

View File

@ -1,6 +1,6 @@
<?php declare(strict_types=1);
namespace Rector\Rector\Contrib\PhpParser;
namespace Rector\PhpParser\Rector;
use PhpParser\Node;
use PhpParser\Node\Expr\MethodCall;

View File

@ -1,6 +1,6 @@
<?php declare(strict_types=1);
namespace Rector\Rector\Contrib\PhpParser;
namespace Rector\PhpParser\Rector;
use PhpParser\Node;
use PhpParser\Node\Expr\PropertyFetch;

View File

@ -1,6 +1,6 @@
<?php declare(strict_types=1);
namespace Rector\Rector\Contrib\PhpParser;
namespace Rector\PhpParser\Rector;
use PhpParser\Node;
use PhpParser\Node\Expr\ConstFetch;

View File

@ -1,6 +1,6 @@
<?php declare(strict_types=1);
namespace Rector\Rector\Contrib\PhpParser;
namespace Rector\PhpParser\Rector;
use PhpParser\Node;
use PhpParser\Node\Expr\MethodCall;

View File

@ -1,6 +1,6 @@
<?php declare(strict_types=1);
namespace Rector\Rector\Contrib\PhpParser;
namespace Rector\PhpParser\Rector;
use PhpParser\Node;
use PhpParser\Node\Expr\PropertyFetch;

View File

@ -0,0 +1,7 @@
services:
_defaults:
autowire: true
Rector\PhpParser\:
resource: '../'
exclude: '../{Rector/**/*Rector.php}'

View File

@ -1,12 +1,12 @@
<?php declare(strict_types=1);
namespace Rector\Tests\Rector\Contrib\PhpParser\CatchAndClosureUseNameRector;
namespace Rector\PhpParser\Tests\Rector\CatchAndClosureUseNameRector;
use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
/**
* @covers \Rector\Rector\Contrib\PhpParser\CatchAndClosureUseNameRector
* @covers \Rector\PhpParser\Rector\CatchAndClosureUseNameRector
*/
final class CatchAndClosureUseNameRectorTest extends AbstractRectorTestCase
{

View File

@ -0,0 +1,2 @@
services:
Rector\PhpParser\Rector\CatchAndClosureUseNameRector: ~

View File

@ -1,12 +1,12 @@
<?php declare(strict_types=1);
namespace Rector\Tests\Rector\Contrib\PhpParser\IdentifierRector;
namespace Rector\PhpParser\Tests\Rector\IdentifierRector;
use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
/**
* @covers \Rector\Rector\Contrib\PhpParser\IdentifierRector
* @covers \Rector\PhpParser\Rector\IdentifierRector
*/
final class IdentifierRectorTest extends AbstractRectorTestCase
{

View File

@ -0,0 +1,2 @@
services:
Rector\PhpParser\Rector\IdentifierRector: ~

View File

@ -1,12 +1,12 @@
<?php declare(strict_types=1);
namespace Rector\Tests\Rector\Contrib\PhpParser\ParamAndStaticVarNameRector;
namespace Rector\PhpParser\Tests\Rector\ParamAndStaticVarNameRector;
use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
/**
* @covers \Rector\Rector\Contrib\PhpParser\ParamAndStaticVarNameRector
* @covers \Rector\PhpParser\Rector\ParamAndStaticVarNameRector
*/
final class ParamAndStaticVarNameRectorTest extends AbstractRectorTestCase
{

View File

@ -0,0 +1,2 @@
services:
Rector\PhpParser\Rector\ParamAndStaticVarNameRector: ~

View File

@ -1,12 +1,12 @@
<?php declare(strict_types=1);
namespace Rector\Tests\Rector\Contrib\PhpParser\RemoveNodeRector;
namespace Rector\PhpParser\Tests\Rector\RemoveNodeRector;
use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
/**
* @covers \Rector\Rector\Contrib\PhpParser\RemoveNodeRector
* @covers \Rector\PhpParser\Rector\RemoveNodeRector
*/
final class RemoveNodeRectorTest extends AbstractRectorTestCase
{

View File

@ -0,0 +1,2 @@
services:
Rector\PhpParser\Rector\RemoveNodeRector: ~

View File

@ -1,12 +1,12 @@
<?php declare(strict_types=1);
namespace Rector\Tests\Rector\Contrib\PhpParser\SetLineRector;
namespace Rector\PhpParser\Tests\Rector\SetLineRector;
use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
/**
* @covers \Rector\Rector\Contrib\PhpParser\SetLineRector
* @covers \Rector\PhpParser\Rector\SetLineRector
*/
final class SetLineRectorTest extends AbstractRectorTestCase
{

View File

@ -0,0 +1,2 @@
services:
Rector\PhpParser\Rector\SetLineRector: ~

View File

@ -1,12 +1,12 @@
<?php declare(strict_types=1);
namespace Rector\Tests\Rector\Contrib\PhpParser\UseWithAliasRector;
namespace Rector\PhpParser\Tests\Rector\UseWithAliasRector;
use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
/**
* @covers \Rector\Rector\Contrib\PhpParser\UseWithAliasRector
* @covers \Rector\PhpParser\Rector\UseWithAliasRector
*/
final class UseWithAliasRectorTest extends AbstractRectorTestCase
{

View File

@ -0,0 +1,2 @@
services:
Rector\PhpParser\Rector\UseWithAliasRector: ~

View File

@ -1,2 +0,0 @@
services:
Rector\Rector\Contrib\PhpParser\CatchAndClosureUseNameRector: ~

View File

@ -1,2 +0,0 @@
services:
Rector\Rector\Contrib\PhpParser\IdentifierRector: ~

View File

@ -1,2 +0,0 @@
services:
Rector\Rector\Contrib\PhpParser\ParamAndStaticVarNameRector: ~

View File

@ -1,2 +0,0 @@
services:
Rector\Rector\Contrib\PhpParser\RemoveNodeRector: ~

View File

@ -1,2 +0,0 @@
services:
Rector\Rector\Contrib\PhpParser\SetLineRector: ~

View File

@ -1,2 +0,0 @@
services:
Rector\Rector\Contrib\PhpParser\UseWithAliasRector: ~