fix PhpParser Rectors

This commit is contained in:
Tomas Votruba 2018-08-05 19:21:12 +02:00
parent 0bed1c2711
commit 8b0b0b468e
5 changed files with 7 additions and 6 deletions

View File

@ -53,12 +53,12 @@ final class AliasToClassRector extends AbstractRector
return new RectorDefinition('Replaces doctrine alias with class.', [
new CodeSample(
<<<'CODE_SAMPLE'
$entityManager = new EntityManager();
$entityManager = new Doctrine\ORM\EntityManager();
$entityManager->getRepository("AppBundle:Post");
CODE_SAMPLE
,
<<<'CODE_SAMPLE'
$entityManager = new Doctrine\EntityManager();
$entityManager = new Doctrine\ORM\EntityManager();
$entityManager->getRepository(\App\Entity\Post::class);
CODE_SAMPLE
),

View File

@ -74,12 +74,12 @@ final class IdentifierRector extends AbstractRector
return new RectorDefinition('Turns node string names to Identifier object in php-parser', [
new CodeSample(
<<<'CODE_SAMPLE'
$constNode = new \PhpParser\Node\Const_;
$constNode = new PhpParser\Node\Const_;
$name = $constNode->name;
CODE_SAMPLE
,
<<<'CODE_SAMPLE'
$constNode = new \PhpParser\Node\Const_;
$constNode = new PhpParser\Node\Const_;
$name = $constNode->name->toString();'
CODE_SAMPLE
),

View File

@ -4,7 +4,7 @@ namespace Roave\BetterReflection\NodeCompiler;
use PhpParser\Node;
class SomeClass
class FourthClass
{
/**
* @var Node\Stmt\ClassMethod|Node\Stmt\Function_|Node\Expr\Closure

View File

@ -4,7 +4,7 @@ namespace Roave\BetterReflection\NodeCompiler;
use PhpParser\Node;
class SomeClass
class FourthClass
{
/**
* @var Node\Stmt\ClassMethod|Node\Stmt\Function_|Node\Expr\Closure

View File

@ -123,6 +123,7 @@ final class PropertyFetchAnalyzer
}
$varNodeTypes = $this->nodeTypeResolver->resolve($node->var);
return (bool) array_intersect($varNodeTypes, $types);
}