mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 13:28:18 +01:00
Updated Rector to commit 6477094d5af502e65c75c30af7ce59ef3b8cc2d7
6477094d5a
Update ArrayDimFetchToMethodCall to use ObjectType (#5728)
This commit is contained in:
parent
d5d197b9bf
commit
dd371cdca2
@ -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)]);
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user