rector/rules/Renaming/ValueObject/RenamedNamespace.php

31 lines
689 B
PHP
Raw Normal View History

2019-10-13 07:59:52 +02:00
<?php
declare (strict_types=1);
2021-04-10 22:21:54 +02:00
namespace Rector\Renaming\ValueObject;
final class RenamedNamespace
{
/**
* @var string
*/
private $currentName;
/**
* @var string
*/
private $oldNamespace;
/**
* @var string
*/
private $newNamespace;
public function __construct(string $currentName, string $oldNamespace, string $newNamespace)
{
$this->currentName = $currentName;
$this->oldNamespace = $oldNamespace;
$this->newNamespace = $newNamespace;
}
public function getNameInNewNamespace() : string
{
return \str_replace($this->oldNamespace, $this->newNamespace, $this->currentName);
}
}