mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-21 01:41:00 +01:00
47 lines
814 B
PHP
47 lines
814 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Rector\Order\ValueObject;
|
|
|
|
use Rector\Order\Contract\RankeableInterface;
|
|
|
|
final class ClassConstRankeable implements RankeableInterface
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $name;
|
|
|
|
/**
|
|
* @var int
|
|
*/
|
|
private $visibility;
|
|
|
|
/**
|
|
* @var int
|
|
*/
|
|
private $position;
|
|
|
|
public function __construct(string $name, int $visibility, int $position)
|
|
{
|
|
$this->name = $name;
|
|
$this->visibility = $visibility;
|
|
$this->position = $position;
|
|
}
|
|
|
|
public function getName(): string
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
/**
|
|
* An array to sort the element order by
|
|
* @return int[]
|
|
*/
|
|
public function getRanks(): array
|
|
{
|
|
return [$this->visibility, $this->position];
|
|
}
|
|
}
|