Conditions | 3 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | 13 | public function getLast(int $offset = 0) : AvailableMigration |
|
22 | { |
||
23 | 13 | $offset = count($this->items) - 1 - (-1 * $offset); |
|
24 | 13 | if (! isset($this->items[$offset])) { |
|
25 | 2 | throw NoMigrationsFoundWithCriteria::new('last' . ($offset > 0 ? '+' . $offset : '')); |
|
26 | } |
||
27 | |||
28 | 11 | return $this->items[$offset]; |
|
29 | } |
||
31 |