mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-05 19:00:49 +00:00
upgrade to nikic/php-parser 4.0-dev
This commit is contained in:
parent
4fe18bacab
commit
595d0f0c3b
|
@ -10,7 +10,7 @@
|
|||
"php": "^7.1",
|
||||
"symfony/console": "^3.3",
|
||||
"symfony/dependency-injection": "^3.3",
|
||||
"nikic/php-parser": "^3.0",
|
||||
"nikic/php-parser": "4.0.x-dev as 3.0.2",
|
||||
"ocramius/code-generator-utils": "^0.4",
|
||||
"nette/utils": "^2.4"
|
||||
},
|
||||
|
|
|
@ -49,7 +49,8 @@ final class InjectAnnotationToConstructorReconstructor implements ReconstructorI
|
|||
|
||||
$propertyType = $propertyDocBlock->getAnnotationsOfType('var')[0]
|
||||
->getTypes()[0];
|
||||
$propertyName = $propertyNode->props[0]->name;
|
||||
$propertyName = (string) $propertyNode->props[0]->name;
|
||||
|
||||
$this->constructorMethodBuilder->addPropertyAssignToClass($classNode, $propertyType, $propertyName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,10 +80,11 @@ final class NamedServicesToConstructorReconstructor implements ReconstructorInte
|
|||
continue;
|
||||
}
|
||||
|
||||
$methodNode = $insideClassNode;
|
||||
|
||||
$methodNode = $insideClassNode;
|
||||
foreach ($methodNode->stmts as $insideMethodNode) {
|
||||
// A. Find $this->get('...')->someCall()
|
||||
$insideMethodNode = $insideMethodNode->expr;
|
||||
|
||||
if ($insideMethodNode instanceof MethodCall && $insideMethodNode->var instanceof MethodCall) {
|
||||
$this->processOnServiceMethodCall($classNode, $insideMethodNode);
|
||||
|
||||
|
@ -151,7 +152,7 @@ final class NamedServicesToConstructorReconstructor implements ReconstructorInte
|
|||
return false;
|
||||
}
|
||||
|
||||
if ($methodCall->name !== 'get') {
|
||||
if ((string) $methodCall->name !== 'get') {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user