mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-14 12:29:43 +01:00
use stable php-parser with arrow functoin
This commit is contained in:
parent
47ff59851a
commit
83f527d571
@ -11,7 +11,7 @@
|
||||
"jetbrains/phpstorm-stubs": "^2019.1",
|
||||
"nette/robot-loader": "^3.1",
|
||||
"nette/utils": "^2.5|^3.0",
|
||||
"nikic/php-parser": "dev-master",
|
||||
"nikic/php-parser": "^4.2.1",
|
||||
"phpstan/phpdoc-parser": "0.3.3",
|
||||
"phpstan/phpstan": "0.11.6",
|
||||
"sebastian/diff": "^3.0",
|
||||
|
@ -59,6 +59,10 @@ CODE_SAMPLE
|
||||
*/
|
||||
public function refactor(Node $node): ?Node
|
||||
{
|
||||
if (! class_exists('PhpParser\Node\Expr\ArrowFunction')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (! $this->isAtLeastPhpVersion('7.4')) {
|
||||
return null;
|
||||
}
|
||||
|
@ -9,6 +9,10 @@ final class ClosureToArrowFunctionRectorTest extends AbstractRectorTestCase
|
||||
{
|
||||
public function test(): void
|
||||
{
|
||||
if (! class_exists('PhpParser\Node\Expr\ArrowFunction')) {
|
||||
$this->markTestSkipped('Wait on php-parser release');
|
||||
}
|
||||
|
||||
$this->doTestFiles([
|
||||
__DIR__ . '/Fixture/fixture.php.inc',
|
||||
__DIR__ . '/Fixture/referenced_but_not_used.php.inc',
|
||||
|
@ -158,3 +158,6 @@ parameters:
|
||||
- '#Anonymous function should have native typehint "string"#'
|
||||
- '#Parameter \#2 \.\.\.\$args of function array_merge expects array, array<int, string\>\|false given#'
|
||||
- '#Method Rector\\Collector\\CallableCollectorPopulator\:\:populate\(\) should return array<Closure\> but returns array<int\|string, callable\>#'
|
||||
|
||||
# waits on php-parser release
|
||||
- '#ArrowFunction#'
|
||||
|
Loading…
x
Reference in New Issue
Block a user