From dd371cdca269aafaa4ac472c0df22f588994a6b9 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 16 Mar 2024 10:32:26 +0000 Subject: [PATCH] Updated Rector to commit 6477094d5af502e65c75c30af7ce59ef3b8cc2d7 https://github.com/rectorphp/rector-src/commit/6477094d5af502e65c75c30af7ce59ef3b8cc2d7 Update ArrayDimFetchToMethodCall to use ObjectType (#5728) --- .../ArrayDimFetchToMethodCallRector.php | 4 ++-- .../ValueObject/ArrayDimFetchToMethodCall.php | 13 +++++++------ src/Application/VersionResolver.php | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/rules/Transform/Rector/ArrayDimFetch/ArrayDimFetchToMethodCallRector.php b/rules/Transform/Rector/ArrayDimFetch/ArrayDimFetchToMethodCallRector.php index 073eb09aa25..df30a5d5c6c 100644 --- a/rules/Transform/Rector/ArrayDimFetch/ArrayDimFetchToMethodCallRector.php +++ b/rules/Transform/Rector/ArrayDimFetch/ArrayDimFetchToMethodCallRector.php @@ -32,7 +32,7 @@ CODE_SAMPLE , <<<'CODE_SAMPLE' $app->make('someService'); CODE_SAMPLE -, [new ArrayDimFetchToMethodCall('SomeClass', 'make')])]); +, [new ArrayDimFetchToMethodCall(new ObjectType('SomeClass'), 'make')])]); } public function getNodeTypes() : array { @@ -50,7 +50,7 @@ CODE_SAMPLE return null; } foreach ($this->arrayDimFetchToMethodCalls as $arrayDimFetchToMethodCall) { - if (!$this->isObjectType($node->var, new ObjectType($arrayDimFetchToMethodCall->getClass()))) { + if (!$this->isObjectType($node->var, $arrayDimFetchToMethodCall->getObjectType())) { continue; } return new MethodCall($node->var, $arrayDimFetchToMethodCall->getMethod(), [new Arg($node->dim)]); diff --git a/rules/Transform/ValueObject/ArrayDimFetchToMethodCall.php b/rules/Transform/ValueObject/ArrayDimFetchToMethodCall.php index 9f2ebb49ae1..c0850b3447b 100644 --- a/rules/Transform/ValueObject/ArrayDimFetchToMethodCall.php +++ b/rules/Transform/ValueObject/ArrayDimFetchToMethodCall.php @@ -3,26 +3,27 @@ declare (strict_types=1); namespace Rector\Transform\ValueObject; +use PHPStan\Type\ObjectType; class ArrayDimFetchToMethodCall { /** * @readonly - * @var string + * @var \PHPStan\Type\ObjectType */ - private $class; + private $objectType; /** * @readonly * @var string */ private $method; - public function __construct(string $class, string $method) + public function __construct(ObjectType $objectType, string $method) { - $this->class = $class; + $this->objectType = $objectType; $this->method = $method; } - public function getClass() : string + public function getObjectType() : ObjectType { - return $this->class; + return $this->objectType; } public function getMethod() : string { diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index e6dabaa74c0..cab5a2d1586 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = 'd9b64c78e33ef461605ac08578c8159b01839c98'; + public const PACKAGE_VERSION = '6477094d5af502e65c75c30af7ce59ef3b8cc2d7'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-03-16 16:08:50'; + public const RELEASE_DATE = '2024-03-16 17:30:11'; /** * @var int */