rector/rules/Order/ValueObject/PropertyRankeable.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

45 lines
1015 B
PHP

<?php
declare (strict_types=1);
namespace Rector\Order\ValueObject;
use PhpParser\Node\Stmt\Property;
use Rector\Order\Contract\RankeableInterface;
final class PropertyRankeable implements \Rector\Order\Contract\RankeableInterface
{
/**
* @var string
*/
private $name;
/**
* @var int
*/
private $visibility;
/**
* @var \PhpParser\Node\Stmt\Property
*/
private $property;
/**
* @var int
*/
private $position;
public function __construct(string $name, int $visibility, \PhpParser\Node\Stmt\Property $property, int $position)
{
$this->name = $name;
$this->visibility = $visibility;
$this->property = $property;
$this->position = $position;
}
public function getName() : string
{
return $this->name;
}
/**
* @return bool[]|int[]
*/
public function getRanks() : array
{
return [$this->visibility, $this->property->isStatic(), $this->position];
}
}