From e26e292ee4e5cedec9e24375e45307498af49bc2 Mon Sep 17 00:00:00 2001 From: TomasVotruba Date: Mon, 5 Apr 2021 12:55:56 +0200 Subject: [PATCH] misc --- phpstan.neon | 3 +-- .../ReplaceSensioRouteAnnotationWithSymfonyRector.php | 4 ++-- .../ClassMethod/TemplateAnnotationToThisRenderRector.php | 2 -- src/TypeAnalyzer/ArrayUnionResponseTypeAnalyzer.php | 1 - 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index e1824489..625aebe1 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -51,5 +51,4 @@ parameters: paths: - tests/bootstrap.php - # fix in rector main, should be string only - - '#Parameter \#1 \$desiredClass of method Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo\:\:getByAnnotationClass\(\) expects class\-string, string given#' + - '#Class with base "ServiceDefinition" name is already used in "(.*?)\\Nette\\DI\\Definitions\\ServiceDefinition", "Rector\\Symfony\\ValueObject\\ServiceDefinition"\. Use unique name to make classes easy to recognize#' diff --git a/src/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector.php b/src/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector.php index 3e20ee60..c7db8f69 100644 --- a/src/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector.php +++ b/src/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector.php @@ -105,8 +105,8 @@ public function refactor(Node $node): ?Node $this->phpDocTagRemover->removeTagValueFromNode($phpDocInfo, $doctrineAnnotationTagValueNode); // unset service, that is deprecated - $items = $doctrineAnnotationTagValueNode->getItems(); - $symfonyRouteTagValueNode = $this->symfonyRouteTagValueNodeFactory->createFromItems($items); + $values = $doctrineAnnotationTagValueNode->getValues(); + $symfonyRouteTagValueNode = $this->symfonyRouteTagValueNodeFactory->createFromItems($values); $phpDocInfo->addTagValueNode($symfonyRouteTagValueNode); diff --git a/src/Rector/ClassMethod/TemplateAnnotationToThisRenderRector.php b/src/Rector/ClassMethod/TemplateAnnotationToThisRenderRector.php index 3c0d04b2..515d32e7 100644 --- a/src/Rector/ClassMethod/TemplateAnnotationToThisRenderRector.php +++ b/src/Rector/ClassMethod/TemplateAnnotationToThisRenderRector.php @@ -298,7 +298,6 @@ private function refactorReturnWithValue( /** @var Expr $lastReturnExpr */ $lastReturnExpr = $return->expr; - $returnStaticType = $this->getStaticType($lastReturnExpr); // phpstan regression fix @@ -309,7 +308,6 @@ private function refactorReturnWithValue( } } - $responseObjectType = new ObjectType(self::RESPONSE_CLASS); if ($responseObjectType->isSuperTypeOf($returnStaticType)->yes()) { return; diff --git a/src/TypeAnalyzer/ArrayUnionResponseTypeAnalyzer.php b/src/TypeAnalyzer/ArrayUnionResponseTypeAnalyzer.php index 93b78e6c..a6992edf 100644 --- a/src/TypeAnalyzer/ArrayUnionResponseTypeAnalyzer.php +++ b/src/TypeAnalyzer/ArrayUnionResponseTypeAnalyzer.php @@ -5,7 +5,6 @@ namespace Rector\Symfony\TypeAnalyzer; use PHPStan\Type\ArrayType; -use PHPStan\Type\ObjectType; use PHPStan\Type\Type; use PHPStan\Type\TypeWithClassName; use PHPStan\Type\UnionType;