Skip to content

Commit

Permalink
Cleanup (#1270)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Nov 18, 2021
1 parent 78829b3 commit 1a4c5fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/PhpAttribute/Printer/PhpAttributeGroupFactory.php
Expand Up @@ -18,6 +18,7 @@
use Rector\Php80\ValueObject\AnnotationToAttribute;
use Rector\PhpAttribute\NodeAnalyzer\NamedArgumentsResolver;
use Rector\PhpAttribute\Value\ValueNormalizer;
use Webmozart\Assert\Assert;

/**
* @see \Rector\Tests\PhpAttribute\Printer\PhpAttributeGroupFactoryTest
Expand Down Expand Up @@ -145,6 +146,8 @@ private function normalizeStringDoubleQuote(Expr $expr): void
*/
private function completeNamedArguments(array $args, array $argumentNames): void
{
Assert::allIsAOf($args, Arg::class);

foreach ($args as $key => $arg) {
$argumentName = $argumentNames[$key] ?? null;
if ($argumentName === null) {
Expand Down
4 changes: 4 additions & 0 deletions rules/Php80/Rector/Class_/AnnotationToAttributeRector.php
Expand Up @@ -223,6 +223,10 @@ private function processGenericTags(PhpDocInfo $phpDocInfo): array
*/
private function processDoctrineAnnotationClasses(PhpDocInfo $phpDocInfo): array
{
if ($phpDocInfo->getPhpDocNode()->children === []) {
return [];
}

$doctrineTagAndAnnotationToAttributes = [];

$phpDocNodeTraverser = new PhpDocNodeTraverser();
Expand Down

0 comments on commit 1a4c5fb

Please sign in to comment.