Skip to content

Commit b9fe6bb

Browse files
committed
fixup! prefix PHP and PHPUnit version with >= in RequiresAnnotationWithValueToAttributeRector
1 parent 29e9b8a commit b9fe6bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rules/AnnotationsToAttributes/NodeFactory/RequiresAttributeFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function create(string $annotationValue): ?AttributeGroup
2626
$attributeClass = 'PHPUnit\Framework\Attributes\RequiresPhp';
2727

2828
// only version is used, we need to prefix with >=
29-
if (is_numeric($attributeValue[0])) {
29+
if (is_string($attributeValue) && is_numeric($attributeValue[0])) {
3030
$attributeValue = '>= ' . $attributeValue;
3131
}
3232

@@ -36,7 +36,7 @@ public function create(string $annotationValue): ?AttributeGroup
3636
$attributeClass = 'PHPUnit\Framework\Attributes\RequiresPhpunit';
3737

3838
// only version is used, we need to prefix with >=
39-
if (is_numeric($attributeValue[0])) {
39+
if (is_string($attributeValue) && is_numeric($attributeValue[0])) {
4040
$attributeValue = '>= ' . $attributeValue;
4141
}
4242

0 commit comments

Comments
 (0)