mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-19 14:27:14 +01:00
7e0a2dbc82
6ad7b03704
Revert Add class-string typehint to MethodCallRename (#2739)
56 lines
1.3 KiB
PHP
56 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\Transform\ValueObject;
|
|
|
|
use Rector\Core\Validation\RectorAssert;
|
|
use Rector\Transform\Contract\ValueObject\ArgumentFuncCallToMethodCallInterface;
|
|
final class ArgumentFuncCallToMethodCall implements ArgumentFuncCallToMethodCallInterface
|
|
{
|
|
/**
|
|
* @readonly
|
|
* @var string
|
|
*/
|
|
private $function;
|
|
/**
|
|
* @readonly
|
|
* @var string
|
|
*/
|
|
private $class;
|
|
/**
|
|
* @readonly
|
|
* @var string|null
|
|
*/
|
|
private $methodIfArgs;
|
|
/**
|
|
* @readonly
|
|
* @var string|null
|
|
*/
|
|
private $methodIfNoArgs;
|
|
public function __construct(string $function, string $class, ?string $methodIfArgs = null, ?string $methodIfNoArgs = null)
|
|
{
|
|
$this->function = $function;
|
|
$this->class = $class;
|
|
$this->methodIfArgs = $methodIfArgs;
|
|
$this->methodIfNoArgs = $methodIfNoArgs;
|
|
RectorAssert::className($class);
|
|
RectorAssert::functionName($function);
|
|
}
|
|
public function getFunction() : string
|
|
{
|
|
return $this->function;
|
|
}
|
|
public function getClass() : string
|
|
{
|
|
return $this->class;
|
|
}
|
|
public function getMethodIfNoArgs() : ?string
|
|
{
|
|
return $this->methodIfNoArgs;
|
|
}
|
|
public function getMethodIfArgs() : ?string
|
|
{
|
|
return $this->methodIfArgs;
|
|
}
|
|
}
|