2020-08-26 12:54:53 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-08-30 20:48:37 +02:00
|
|
|
namespace Rector\Transform\ValueObject;
|
2020-08-26 12:54:53 +02:00
|
|
|
|
2021-02-27 03:13:22 +01:00
|
|
|
use PHPStan\Type\ObjectType;
|
|
|
|
|
2020-09-12 23:19:08 +02:00
|
|
|
final class ReplaceParentCallByPropertyCall
|
2020-08-26 12:54:53 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $class;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $method;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $property;
|
|
|
|
|
|
|
|
public function __construct(string $class, string $method, string $property)
|
|
|
|
{
|
|
|
|
$this->class = $class;
|
|
|
|
$this->method = $method;
|
|
|
|
$this->property = $property;
|
|
|
|
}
|
|
|
|
|
2021-02-27 03:13:22 +01:00
|
|
|
public function getObjectType(): ObjectType
|
2020-08-26 12:54:53 +02:00
|
|
|
{
|
2021-02-27 03:13:22 +01:00
|
|
|
return new ObjectType($this->class);
|
2020-08-26 12:54:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getMethod(): string
|
|
|
|
{
|
|
|
|
return $this->method;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getProperty(): string
|
|
|
|
{
|
|
|
|
return $this->property;
|
|
|
|
}
|
|
|
|
}
|