Skip to content

Commit

Permalink
Updated Rector to commit 7ad142473531a56d8eb6d9d7571f0d77b0661fbf
Browse files Browse the repository at this point in the history
rectorphp/rector-src@7ad1424 [Php80] Keep numeric string, string "true", "false" as is on StringAnnotationToAttributeMapper (#6610)
  • Loading branch information
TomasVotruba committed Jan 5, 2025
1 parent 934bc26 commit d7d4304
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '8ed98c17688300b3aa85d978fefc24c88a51f1f3';
public const PACKAGE_VERSION = '7ad142473531a56d8eb6d9d7571f0d77b0661fbf';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2025-01-05 11:09:27';
public const RELEASE_DATE = '2025-01-05 09:23:30';
/**
* @var int
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
namespace Rector\PhpAttribute\AnnotationToAttributeMapper;

use PhpParser\Node\Expr;
use PhpParser\Node\Expr\ConstFetch;
use PhpParser\Node\Name;
use PhpParser\Node\Scalar\Int_;
use PhpParser\Node\Scalar\String_;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PhpAttribute\Contract\AnnotationToAttributeMapperInterface;
Expand All @@ -27,19 +24,6 @@ public function isCandidate($value) : bool
*/
public function map($value) : Expr
{
if (\strtolower($value) === 'true') {
return new ConstFetch(new Name('true'));
}
if (\strtolower($value) === 'false') {
return new ConstFetch(new Name('false'));
}
if (\strtolower($value) === 'null') {
return new ConstFetch(new Name('null'));
}
// number as string to number
if (\is_numeric($value) && \strlen((string) (int) $value) === \strlen($value)) {
return Int_::fromString($value);
}
if (\strpos($value, "'") !== \false && \strpos($value, "\n") === \false) {
$kind = String_::KIND_DOUBLE_QUOTED;
} else {
Expand Down

0 comments on commit d7d4304

Please sign in to comment.