Closed romainallanot closed 3 years ago
PHP Fatal error: Uncaught LogicException: Invalid value in rector/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php:220 when value is an instance of PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprFalseNode.
<?php use ApiPlatform\Core\Annotation\ApiResource; /** * @ApiResource( * collectionOperations={}, * itemOperations={ * "get", * "get_by_isbn"={"method"="GET", "path"="/books/by_isbn/{isbn}.{_format}", "requirements"={"isbn"=".+"}, "identifiers"="isbn"} * }, * graphql={ * "sumOnlyPersist"={ * "mutation"="app.graphql.mutation_resolver.dummy_custom_only_persist", * "normalization_context"={"groups"={"result"}}, * "denormalization_context"={"groups"={"sum"}}, * "read"=false, * "deserialize"=false, * "validate"=false, * "serialize"=false * } * } * ) */ class ApiPlatformResource {}
<?php use Rector\Php74\Rector\Property\TypedPropertyRector; use Rector\Set\ValueObject\SetList; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return static function (ContainerConfigurator $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(AnnotationToAttributeRector::class) ->call('configure', [[ AnnotationToAttributeRector::ANNOTATION_TO_ATTRIBUTE => ValueObjectInliner::inline([ new AnnotationToAttribute( 'ApiPlatform\Core\Annotation\ApiResource', 'ApiPlatform\Core\Annotation\ApiResource' ), ]), ]]); };
Normalize array node values in PhpAttributeFactory
It seems fixed at https://github.com/rectorphp/rector-src/pull/190
Bug Report
PHP Fatal error: Uncaught LogicException: Invalid value in rector/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php:220 when value is an instance of PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprFalseNode.
Minimal PHP Code Causing Issue
Expected Behaviour
Normalize array node values in PhpAttributeFactory