| Total Complexity | 6 |
| Total Lines | 74 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Location implements SerializationInterface |
||
| 9 | { |
||
| 10 | use ArrayToJsonTrait; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var int |
||
| 14 | */ |
||
| 15 | protected $start; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var int |
||
| 19 | */ |
||
| 20 | protected $end; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var Source|null |
||
| 24 | */ |
||
| 25 | protected $source; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Location constructor. |
||
| 29 | * |
||
| 30 | * @param int $start |
||
| 31 | * @param int $end |
||
| 32 | * @param Source|null $source |
||
| 33 | */ |
||
| 34 | public function __construct(int $start, int $end, ?Source $source = null) |
||
| 35 | { |
||
| 36 | $this->start = $start; |
||
| 37 | $this->end = $end; |
||
| 38 | $this->source = $source; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return int |
||
| 43 | */ |
||
| 44 | public function getStart(): int |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return int |
||
| 51 | */ |
||
| 52 | public function getEnd(): int |
||
| 53 | { |
||
| 54 | return $this->end; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return Source|null |
||
| 59 | */ |
||
| 60 | public function getSource(): ?Source |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @return array |
||
| 67 | */ |
||
| 68 | public function toArray(): array |
||
| 73 | ]; |
||
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @return string |
||
| 78 | */ |
||
| 79 | public function __toString(): string |
||
| 84 |