rector/rules/Transform/ValueObject/ArgumentFuncCallToMethodCall.php
Tomas Votruba 7e0a2dbc82 Updated Rector to commit 6ad7b03704e639c95759d14c67444009c3b93259
6ad7b03704 Revert Add class-string typehint to MethodCallRename (#2739)
2022-08-06 15:23:35 +00:00

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;
}
}