mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 03:35:01 +01:00
48 lines
847 B
PHP
48 lines
847 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Rector\Transform\ValueObject;
|
|
|
|
use PHPStan\Type\ObjectType;
|
|
|
|
final class ServiceGetterToConstructorInjection
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $oldType;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $oldMethod;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $serviceType;
|
|
|
|
public function __construct(string $oldType, string $oldMethod, string $serviceType)
|
|
{
|
|
$this->oldType = $oldType;
|
|
$this->oldMethod = $oldMethod;
|
|
$this->serviceType = $serviceType;
|
|
}
|
|
|
|
public function getOldObjectType(): ObjectType
|
|
{
|
|
return new ObjectType($this->oldType);
|
|
}
|
|
|
|
public function getOldMethod(): string
|
|
{
|
|
return $this->oldMethod;
|
|
}
|
|
|
|
public function getServiceType(): string
|
|
{
|
|
return $this->serviceType;
|
|
}
|
|
}
|