mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-28 13:43:31 +00:00
c726969380
fc10fce13d
[Rectify] [Php81] Enable Rectify on Readonly Property only (#1384)
45 lines
1.0 KiB
PHP
45 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\Transform\ValueObject;
|
|
|
|
use PHPStan\Type\ObjectType;
|
|
use Rector\Core\Validation\RectorAssert;
|
|
final class UnsetAndIssetToMethodCall
|
|
{
|
|
/**
|
|
* @readonly
|
|
* @var string
|
|
*/
|
|
private $type;
|
|
/**
|
|
* @readonly
|
|
* @var string
|
|
*/
|
|
private $issetMethodCall;
|
|
/**
|
|
* @readonly
|
|
* @var string
|
|
*/
|
|
private $unsedMethodCall;
|
|
public function __construct(string $type, string $issetMethodCall, string $unsedMethodCall)
|
|
{
|
|
$this->type = $type;
|
|
$this->issetMethodCall = $issetMethodCall;
|
|
$this->unsedMethodCall = $unsedMethodCall;
|
|
\Rector\Core\Validation\RectorAssert::className($type);
|
|
}
|
|
public function getObjectType() : \PHPStan\Type\ObjectType
|
|
{
|
|
return new \PHPStan\Type\ObjectType($this->type);
|
|
}
|
|
public function getIssetMethodCall() : string
|
|
{
|
|
return $this->issetMethodCall;
|
|
}
|
|
public function getUnsedMethodCall() : string
|
|
{
|
|
return $this->unsedMethodCall;
|
|
}
|
|
}
|