mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-19 14:27:14 +01:00
fix PhpParser Rectors
This commit is contained in:
parent
0bed1c2711
commit
8b0b0b468e
@ -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
|
||||
),
|
||||
|
@ -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
|
||||
),
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -123,6 +123,7 @@ final class PropertyFetchAnalyzer
|
||||
}
|
||||
|
||||
$varNodeTypes = $this->nodeTypeResolver->resolve($node->var);
|
||||
|
||||
return (bool) array_intersect($varNodeTypes, $types);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user