Updated Rector to commit 6477094d5af502e65c75c30af7ce59ef3b8cc2d7

6477094d5a Update ArrayDimFetchToMethodCall to use ObjectType (#5728)
This commit is contained in:
Tomas Votruba 2024-03-16 10:32:26 +00:00
parent d5d197b9bf
commit dd371cdca2
3 changed files with 11 additions and 10 deletions

View File

@ -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)]);

View File

@ -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
{

View File

@ -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
*/