Skip to content

Commit

Permalink
Little cleanup (#2810)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Aug 20, 2022
1 parent a33b200 commit 8e75310
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\BetterPhpDocParser\PhpDocParser\ClassAnnotationMatcher;
use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode;
use Rector\BetterPhpDocParser\ValueObject\PhpDocAttributeKey;

final class PhpDocClassRenamer
{
Expand Down Expand Up @@ -67,7 +68,7 @@ private function processAssertChoiceTagValueNode(array $oldToNewClasses, PhpDocI
$classNameArrayItemNode->value = $newClass;

// trigger reprint
$classNameArrayItemNode->setAttribute('orig_node', null);
$classNameArrayItemNode->setAttribute(PhpDocAttributeKey::ORIG_NODE, null);
break;
}
}
Expand Down Expand Up @@ -118,7 +119,7 @@ private function processSerializerTypeTagValueNode(array $oldToNewClasses, PhpDo
$newClass
);

$classNameArrayItemNode->setAttribute('orig_node', null);
$classNameArrayItemNode->setAttribute(PhpDocAttributeKey::ORIG_NODE, null);
}

$currentTypeArrayItemNode = $doctrineAnnotationTagValueNode->getValue('type');
Expand Down Expand Up @@ -160,7 +161,7 @@ private function processDoctrineToMany(
}

$targetEntityArrayItemNode->value = $newClass;
$targetEntityArrayItemNode->setAttribute('orig_node', null);
$targetEntityArrayItemNode->setAttribute(PhpDocAttributeKey::ORIG_NODE, null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Tests\CodingStyle\Rector\FuncCall\VersionCompareFuncCallToConst

class SkipIndirectStringNumber
{
private const MIN_PHP_VERSION = 'Php73';
private const MIN_PHP_VERSION = '7.2';

public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class SkipElsefis
// current PHP: 10.0
if (1 == version_compare(PHP_VERSION, '7.2', '<')) {
return 'is PHP 7.1-';
} elseif (1 == version_compare(PHP_VERSION, 'Php73', '<')) {
} elseif (1 == version_compare(PHP_VERSION, '7.3', '<')) {
return 'hop';
} else {
return 'is PHP 7.2+';
Expand Down

0 comments on commit 8e75310

Please sign in to comment.