rector/rules/Renaming/ValueObject/RenamedNamespace.php
Tomas Votruba c726969380 Updated Rector to commit fc10fce13dcf9767f54e4202b509020fed338645
fc10fce13d [Rectify] [Php81] Enable Rectify on Readonly Property only (#1384)
2021-12-04 12:47:17 +00:00

34 lines
740 B
PHP

<?php
declare (strict_types=1);
namespace Rector\Renaming\ValueObject;
final class RenamedNamespace
{
/**
* @readonly
* @var string
*/
private $currentName;
/**
* @readonly
* @var string
*/
private $oldNamespace;
/**
* @readonly
* @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);
}
}