rector/rules/Renaming/ValueObject/RenamedNamespace.php
Tomas Votruba cdc3b7adef Updated Rector to commit f451b0b8e1e6761ec7f50809745d44d01caba66d
f451b0b8e1 [PHP 8.0] Bump to promoted properties (#4)
2021-05-10 23:39:21 +00:00

31 lines
689 B
PHP

<?php
declare (strict_types=1);
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);
}
}