-
-
Notifications
You must be signed in to change notification settings - Fork 737
Closed
rectorphp/rector-src
#2929Description
When I run rector on file:
`
final class GetItems implements RequestInterface
{
public const DEFAULT_ITEMS_FILTER = ProductCriteria::FILTER_ITEMS_ALL;
public const DEFAULT_OFFSET = 0;
public const DEFAULT_LIMIT = 100;
/**
* @Assert\All({
* @Assert\Uuid()
* })
*/
public array $selected = [];
#[Assert\Type('string'), Assert\Choice(ProductCriteria::ALLOWED_FILTER_ITEMS)]
public string $filterItems = self::DEFAULT_ITEMS_FILTER;
#[Assert\Type('integer')]
public int $limit = self::DEFAULT_LIMIT;
#[Assert\Type('integer')]
public int $offset = self::DEFAULT_OFFSET;
public function createProductCriteria(): ProductCriteria
{
$pc = new ProductCriteria();
$pc->filterItems = $this->filterItems;
$pc->selected = $this->selected;
$pc->limit = $this->limit;
$pc->offset = $this->offset;
return $pc;
}
}
`
I got the errors below:
`
[ERROR] Could not process "/app/src/Storefront/UI/Theme/Request/GetItems.php" file, due to:
"System error: "PhpParser\Node\Expr\ArrayItem::__construct(): Argument #1 ($value) must be of type PhpParser\Node\Expr,
string given, called in
vendor/rector/rector/packages/PhpAttribute/AnnotationToAttributeMapper/ArrayItemNodeAnnotationToAttributeMapper.php:61"
Stack trace:
#0
vendor/rector/rector/packages/PhpAttribute/AnnotationToAttributeMapper/ArrayItemNodeAnnotationToAttributeMapper.php(61):
PhpParser\Node\Expr\ArrayItem->__construct('__remove_array_...', NULL)
#1 vendor/rector/rector/packages/PhpAttribute/AnnotationToAttributeMapper.php(37):
Rector\PhpAttribute\AnnotationToAttributeMapper\ArrayItemNodeAnnotationToAttributeMapper->map(Object(Rector\BetterPhpDo
cParser\PhpDoc\ArrayItemNode))
#2
vendor/rector/rector/packages/PhpAttribute/AnnotationToAttributeMapper/CurlyListNodeAnnotationToAttributeMapper.php(48):
Rector\PhpAttribute\AnnotationToAttributeMapper->map(Object(Rector\BetterPhpDocParser\PhpDoc\ArrayItemNode))
#3 vendor/rector/rector/packages/PhpAttribute/AnnotationToAttributeMapper.php(37):
Rector\PhpAttribute\AnnotationToAttributeMapper\CurlyListNodeAnnotationToAttributeMapper->map(Object(Rector\BetterPhpDo
cParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode))
#4
vendor/rector/rector/packages/PhpAttribute/AnnotationToAttributeMapper/ArrayItemNodeAnnotationToAttributeMapper.php(42):
Rector\PhpAttribute\AnnotationToAttributeMapper->map(Object(Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnota
tion\CurlyListNode))
#5 vendor/rector/rector/packages/PhpAttribute/AnnotationToAttributeMapper.php(37):
Rector\PhpAttribute\AnnotationToAttributeMapper\ArrayItemNodeAnnotationToAttributeMapper->map(Object(Rector\BetterPhpDo
cParser\PhpDoc\ArrayItemNode))
#6 vendor/rector/rector/packages/PhpAttribute/AnnotationToAttributeMapper/ArrayAnnotationToAttributeMapper.php(58):
Rector\PhpAttribute\AnnotationToAttributeMapper->map(Object(Rector\BetterPhpDocParser\PhpDoc\ArrayItemNode))
#7 vendor/rector/rector/packages/PhpAttribute/AnnotationToAttributeMapper.php(37):
Rector\PhpAttribute\AnnotationToAttributeMapper\ArrayAnnotationToAttributeMapper->map(Array)
#8 vendor/rector/rector/packages/PhpAttribute/NodeFactory/PhpAttributeGroupFactory.php(98):
Rector\PhpAttribute\AnnotationToAttributeMapper->map(Array)
#9 vendor/rector/rector/packages/PhpAttribute/NodeFactory/PhpAttributeGroupFactory.php(83):
Rector\PhpAttribute\NodeFactory\PhpAttributeGroupFactory->createArgsFromItems(Array, 'Symfony\\Compone...')
#10 vendor/rector/rector/rules/Php80/NodeFactory/AttrGroupsFactory.php(32):
Rector\PhpAttribute\NodeFactory\PhpAttributeGroupFactory->create(Object(Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnota
tionTagValueNode), Object(Rector\Php80\ValueObject\AnnotationToAttribute), Array)
#11 vendor/rector/rector/rules/Php80/Rector/Class_/AnnotationToAttributeRector.php(206):
Rector\Php80\NodeFactory\AttrGroupsFactory->create(Array, Array)
#12 vendor/rector/rector/rules/Php80/Rector/Class_/AnnotationToAttributeRector.php(128):
Rector\Php80\Rector\Class_\AnnotationToAttributeRector->processDoctrineAnnotationClasses(Object(Rector\BetterPhpDocPars
er\PhpDocInfo\PhpDocInfo), Array)
#13 vendor/rector/rector/src/Rector/AbstractRector.php(212):
Rector\Php80\Rector\Class_\AnnotationToAttributeRector->refactor(Object(PhpParser\Node\Stmt\Property))
#14 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(176):
Rector\Core\Rector\AbstractRector->enterNode(Object(PhpParser\Node\Stmt\Property))
#15 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105):
PhpParser\NodeTraverser->traverseArray(Array)
#16 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196):
PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Stmt\Class_))
#17 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105):
PhpParser\NodeTraverser->traverseArray(Array)
#18 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196):
PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Stmt\Namespace_))
#19 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(85):
PhpParser\NodeTraverser->traverseArray(Array)
#20 vendor/rector/rector/src/PhpParser/NodeTraverser/RectorNodeTraverser.php(42):
PhpParser\NodeTraverser->traverse(Array)
#21 vendor/rector/rector/src/Application/FileProcessor.php(60):
Rector\Core\PhpParser\NodeTraverser\RectorNodeTraverser->traverse(Array)
#22 vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(133):
Rector\Core\Application\FileProcessor->refactor(Object(Rector\Core\ValueObject\Application\File),
Object(Rector\Core\ValueObject\Configuration))
#23 vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(100):
Rector\Core\Application\FileProcessor\PhpFileProcessor->refactorNodesWithRectors(Object(Rector\Core\ValueObject\Applica
tion\File), Object(Rector\Core\ValueObject\Configuration))
#24 vendor/rector/rector/packages/Parallel/WorkerRunner.php(98):
Rector\Core\Application\FileProcessor\PhpFileProcessor->process(Object(Rector\Core\ValueObject\Application\File),
Object(Rector\Core\ValueObject\Configuration))
#25 vendor/rector/rector/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(97):
Rector\Parallel\WorkerRunner->Rector\Parallel\{closure}(Array)
#26 vendor/rector/rector/vendor/clue/ndjson-react/src/Decoder.php(110):
RectorPrefix202209\Evenement\EventEmitter->emit('data', Array)
#27 vendor/rector/rector/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(97):
RectorPrefix202209\Clue\React\NDJson\Decoder->handleData(Array)
#28 vendor/rector/rector/vendor/react/stream/src/Util.php(62): RectorPrefix202209\Evenement\EventEmitter->emit('data',
Array)
#29 vendor/rector/rector/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(97):
RectorPrefix202209\React\Stream\Util::RectorPrefix202209\React\Stream\{closure}('{"action":"main...')
#30 vendor/rector/rector/vendor/react/stream/src/DuplexResourceStream.php(154):
RectorPrefix202209\Evenement\EventEmitter->emit('data', Array)
#31 vendor/rector/rector/vendor/react/event-loop/src/StreamSelectLoop.php(201):
RectorPrefix202209\React\Stream\DuplexResourceStream->handleData(Resource id #3055)
#32 vendor/rector/rector/vendor/react/event-loop/src/StreamSelectLoop.php(173):
RectorPrefix202209\React\EventLoop\StreamSelectLoop->waitForStreamActivity(NULL)
#33 vendor/rector/rector/src/Console/Command/WorkerCommand.php(63):
RectorPrefix202209\React\EventLoop\StreamSelectLoop->run()
#34 vendor/rector/rector/vendor/symfony/console/Command/Command.php(307):
Rector\Core\Console\Command\WorkerCommand->execute(Object(RectorPrefix202209\Symfony\Component\Console\Input\ArgvInput)
, Object(RectorPrefix202209\Symfony\Component\Console\Output\ConsoleOutput))
#35 vendor/rector/rector/vendor/symfony/console/Application.php(894):
RectorPrefix202209\Symfony\Component\Console\Command\Command->run(Object(RectorPrefix202209\Symfony\Component\Console\I
nput\ArgvInput), Object(RectorPrefix202209\Symfony\Component\Console\Output\ConsoleOutput))
#36 vendor/rector/rector/vendor/symfony/console/Application.php(310):
RectorPrefix202209\Symfony\Component\Console\Application->doRunCommand(Object(Rector\Core\Console\Command\WorkerCommand
), Object(RectorPrefix202209\Symfony\Component\Console\Input\ArgvInput),
Object(RectorPrefix202209\Symfony\Component\Console\Output\ConsoleOutput))
#37 vendor/rector/rector/src/Console/ConsoleApplication.php(49):
RectorPrefix202209\Symfony\Component\Console\Application->doRun(Object(RectorPrefix202209\Symfony\Component\Console\Inp
ut\ArgvInput), Object(RectorPrefix202209\Symfony\Component\Console\Output\ConsoleOutput))
#38 vendor/rector/rector/vendor/symfony/console/Application.php(208):
Rector\Core\Console\ConsoleApplication->doRun(Object(RectorPrefix202209\Symfony\Component\Console\Input\ArgvInput),
Object(RectorPrefix202209\Symfony\Component\Console\Output\ConsoleOutput))
#39 vendor/rector/rector/bin/rector.php(128): RectorPrefix202209\Symfony\Component\Console\Application->run()
#40 vendor/rector/rector/bin/rector(5): require_once('vendor/rec...')
#41 bin/rector(117): include('vendor/rec...')
#42 {main}". On line: 25
`
Metadata
Metadata
Assignees
Labels
No labels