Skip to content

Commit

Permalink
remove extra parma in value object
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jun 22, 2021
1 parent 7bba40a commit c2ce610
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config/set/downgrade-php80.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
$services->set(DowngradeAttributeToAnnotationRector::class)
->call('configure', [[
DowngradeAttributeToAnnotationRector::ATTRIBUTE_TO_ANNOTATION => ValueObjectInliner::inline([
new DowngradeAttributeToAnnotation('Attribute', 'Attribute'),
new DowngradeAttributeToAnnotation('Attribute'),
]),
]]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ public function action()
,
[
self::ATTRIBUTE_TO_ANNOTATION => [
new DowngradeAttributeToAnnotation(
'Symfony\Component\Routing\Annotation\Route',
'Symfony\Component\Routing\Annotation\Route'
),
new DowngradeAttributeToAnnotation('Symfony\Component\Routing\Annotation\Route'),
],
]
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ final class DowngradeAttributeToAnnotation
{
/**
* @param class-string $attributeClass
* @param class-string|string $tag
* @param class-string|string|null $tag
*/
public function __construct(
private string $attributeClass,
private string $tag
private ?string $tag = null
) {
}

Expand All @@ -23,6 +23,10 @@ public function getAttributeClass(): string

public function getTag(): string
{
if ($this->tag === null) {
return $this->attributeClass;
}

return $this->tag;
}
}

0 comments on commit c2ce610

Please sign in to comment.