rector/packages/BetterPhpDocParser/ValueObject/StartAndEnd.php
Tomas Votruba 727b9f46f0 Updated Rector to commit bfa1891c50677b01136a9308fd3c3ecc12e267d9
bfa1891c50 [cleanup] Remove 73 unused public methods (#3245)
2022-12-23 17:10:25 +00:00

36 lines
664 B
PHP

<?php
declare (strict_types=1);
namespace Rector\BetterPhpDocParser\ValueObject;
use Rector\Core\Exception\ShouldNotHappenException;
final class StartAndEnd
{
/**
* @readonly
* @var int
*/
private $start;
/**
* @readonly
* @var int
*/
private $end;
public function __construct(int $start, int $end)
{
$this->start = $start;
$this->end = $end;
if ($end < $start) {
throw new ShouldNotHappenException();
}
}
public function getStart() : int
{
return $this->start;
}
public function getEnd() : int
{
return $this->end;
}
}