2020-08-26 10:54:53 +00:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2022-06-06 17:12:56 +00:00
|
|
|
namespace Rector\Transform\ValueObject;
|
2020-08-26 10:54:53 +00:00
|
|
|
|
2022-06-06 17:12:56 +00:00
|
|
|
use PHPStan\Type\ObjectType;
|
2024-01-02 02:40:38 +00:00
|
|
|
use Rector\Validation\RectorAssert;
|
2020-08-30 18:48:37 +00:00
|
|
|
final class StaticCallToFuncCall
|
2020-08-26 10:54:53 +00:00
|
|
|
{
|
|
|
|
/**
|
2023-06-11 23:01:39 +00:00
|
|
|
* @readonly
|
2022-08-06 15:23:35 +00:00
|
|
|
* @var string
|
2020-08-26 10:54:53 +00:00
|
|
|
*/
|
|
|
|
private $class;
|
|
|
|
/**
|
2023-06-11 23:01:39 +00:00
|
|
|
* @readonly
|
2020-08-26 10:54:53 +00:00
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $method;
|
|
|
|
/**
|
2023-06-11 23:01:39 +00:00
|
|
|
* @readonly
|
2020-08-26 10:54:53 +00:00
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $function;
|
|
|
|
public function __construct(string $class, string $method, string $function)
|
|
|
|
{
|
|
|
|
$this->class = $class;
|
|
|
|
$this->method = $method;
|
|
|
|
$this->function = $function;
|
2022-06-07 08:22:29 +00:00
|
|
|
RectorAssert::className($class);
|
2022-07-16 09:41:53 +00:00
|
|
|
RectorAssert::methodName($method);
|
|
|
|
RectorAssert::functionName($function);
|
2020-08-26 10:54:53 +00:00
|
|
|
}
|
2022-06-07 08:22:29 +00:00
|
|
|
public function getObjectType() : ObjectType
|
2020-08-26 10:54:53 +00:00
|
|
|
{
|
2022-06-07 08:22:29 +00:00
|
|
|
return new ObjectType($this->class);
|
2020-08-26 10:54:53 +00:00
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getMethod() : string
|
2020-08-26 10:54:53 +00:00
|
|
|
{
|
|
|
|
return $this->method;
|
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getFunction() : string
|
2020-08-26 10:54:53 +00:00
|
|
|
{
|
|
|
|
return $this->function;
|
|
|
|
}
|
|
|
|
}
|