mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 22:08:00 +01:00
aa2cb1b997
0eba231b07
[PHP 8.1] Move ConstantListClassToEnumRector to PHP 8.1 (#2444)
36 lines
682 B
PHP
36 lines
682 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\Naming\ValueObject;
|
|
|
|
final class ExpectedName
|
|
{
|
|
/**
|
|
* @readonly
|
|
* @var string
|
|
*/
|
|
private $name;
|
|
/**
|
|
* @readonly
|
|
* @var string
|
|
*/
|
|
private $singularized;
|
|
public function __construct(string $name, string $singularized)
|
|
{
|
|
$this->name = $name;
|
|
$this->singularized = $singularized;
|
|
}
|
|
public function getName() : string
|
|
{
|
|
return $this->name;
|
|
}
|
|
public function getSingularized() : string
|
|
{
|
|
return $this->singularized;
|
|
}
|
|
public function isSingular() : bool
|
|
{
|
|
return $this->name === $this->singularized;
|
|
}
|
|
}
|