mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-25 04:03:55 +01:00
6577da612c
[DX] Add input validation for method, property and function name to avoid invalid output ast (#2668)
35 lines
736 B
PHP
35 lines
736 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\Transform\ValueObject;
|
|
|
|
use Rector\Core\Validation\RectorAssert;
|
|
final class StaticCallRecipe
|
|
{
|
|
/**
|
|
* @readonly
|
|
* @var string
|
|
*/
|
|
private $className;
|
|
/**
|
|
* @readonly
|
|
* @var string
|
|
*/
|
|
private $methodName;
|
|
public function __construct(string $className, string $methodName)
|
|
{
|
|
$this->className = $className;
|
|
$this->methodName = $methodName;
|
|
RectorAssert::className($className);
|
|
RectorAssert::methodName($methodName);
|
|
}
|
|
public function getClassName() : string
|
|
{
|
|
return $this->className;
|
|
}
|
|
public function getMethodName() : string
|
|
{
|
|
return $this->methodName;
|
|
}
|
|
}
|