upgrade to nikic/php-parser 4.0-dev

This commit is contained in:
TomasVotruba 2017-07-16 22:43:11 +02:00
parent 4fe18bacab
commit 595d0f0c3b
3 changed files with 7 additions and 5 deletions

View File

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

View File

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

View File

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