| @@ 584-614 (lines=31) @@ | ||
| 581 | * |
|
| 582 | * @return bool|array |
|
| 583 | */ |
|
| 584 | private function getNavigationError($pos, $isFirst, $isLast) { |
|
| 585 | ||
| 586 | if ($pos === 0) { |
|
| 587 | if ($this->navigateLastError === true) { |
|
| 588 | return end($this->errors); |
|
| 589 | } else { |
|
| 590 | return current($this->errors); |
|
| 591 | } |
|
| 592 | } |
|
| 593 | ||
| 594 | $this->navigateLastError = false; |
|
| 595 | if ($pos === -99) { |
|
| 596 | return reset($this->errors); |
|
| 597 | } |
|
| 598 | ||
| 599 | if ($pos === -1 && !$isFirst) { |
|
| 600 | return prev($this->errors); |
|
| 601 | } |
|
| 602 | ||
| 603 | if ($pos === 1 && !$isLast) { |
|
| 604 | return next($this->errors); |
|
| 605 | } |
|
| 606 | ||
| 607 | if ($pos === 99) { |
|
| 608 | $this->navigateLastError = true; |
|
| 609 | ||
| 610 | return end($this->errors); |
|
| 611 | } |
|
| 612 | ||
| 613 | return false; |
|
| 614 | } |
|
| 615 | ||
| 616 | ||
| 617 | /** |
|
| @@ 511-541 (lines=31) @@ | ||
| 508 | * |
|
| 509 | * @return bool|array |
|
| 510 | */ |
|
| 511 | private function getNavigationError($pos, $isFirst, $isLast) { |
|
| 512 | ||
| 513 | if ($pos === 0) { |
|
| 514 | if ($this->navigateLastError === true) { |
|
| 515 | return end($this->errors); |
|
| 516 | } else { |
|
| 517 | return current($this->errors); |
|
| 518 | } |
|
| 519 | } |
|
| 520 | ||
| 521 | $this->navigateLastError = false; |
|
| 522 | if ($pos === -99) { |
|
| 523 | return reset($this->errors); |
|
| 524 | } |
|
| 525 | ||
| 526 | if ($pos === -1 && !$isFirst) { |
|
| 527 | return prev($this->errors); |
|
| 528 | } |
|
| 529 | ||
| 530 | if ($pos === 1 && !$isLast) { |
|
| 531 | return next($this->errors); |
|
| 532 | } |
|
| 533 | ||
| 534 | if ($pos === 99) { |
|
| 535 | $this->navigateLastError = true; |
|
| 536 | ||
| 537 | return end($this->errors); |
|
| 538 | } |
|
| 539 | ||
| 540 | return false; |
|
| 541 | } |
|
| 542 | ||
| 543 | ||
| 544 | /** |
|