← All changes
|
vendor/wpfluent/framework/src/WPFluent/Pagination/UrlWindow.php
+13
-9
1.5.21
→
2.5.0
View file →
| @@ -41,8 +41,9 @@ | ||
| 41 | 41 | * @return array |
| 42 | 42 | */ |
| 43 | 43 | public function get() |
| 44 | 44 | { |
| 45 | + // @phpstan-ignore-next-line | |
| 45 | 46 | $onEachSide = $this->paginator->onEachSide; |
| 46 | 47 | |
| 47 | 48 | if ($this->paginator->lastPage() < ($onEachSide * 2) + 8) { |
| 48 | 49 | return $this->getSmallSlider(); |
| @@ -78,25 +79,28 @@ | ||
| 78 | 79 | if (! $this->hasPages()) { |
| 79 | 80 | return ['first' => null, 'slider' => null, 'last' => null]; |
| 80 | 81 | } |
| 81 | 82 | |
| 82 | - // If the current page is very close to the beginning of the page range, we will | |
| 83 | - // just render the beginning of the page range, followed by the last 2 of the | |
| 84 | - // links in this list, since we will not have room to create a full slider. | |
| 83 | + // If the current page is very close to the beginning of the page range, | |
| 84 | + // we will just render the beginning of the page range, followed | |
| 85 | + // by the last 2 of the links in this list, since we | |
| 86 | + // will not have room to create a full slider. | |
| 85 | 87 | if ($this->currentPage() <= $window) { |
| 86 | 88 | return $this->getSliderTooCloseToBeginning($window, $onEachSide); |
| 87 | 89 | } |
| 88 | 90 | |
| 89 | - // If the current page is close to the ending of the page range we will just get | |
| 90 | - // this first couple pages, followed by a larger window of these ending pages | |
| 91 | - // since we're too close to the end of the list to create a full on slider. | |
| 91 | + // If the current page is close to the ending of the page range, we will | |
| 92 | + // just get this first couple pages, followed by a larger window of | |
| 93 | + // these ending pages since we're too close to the end of | |
| 94 | + // the list to create a full on slider. | |
| 92 | 95 | if ($this->currentPage() > ($this->lastPage() - $window)) { |
| 93 | 96 | return $this->getSliderTooCloseToEnding($window, $onEachSide); |
| 94 | 97 | } |
| 95 | 98 | |
| 96 | - // If we have enough room on both sides of the current page to build a slider we | |
| 97 | - // will surround it with both the beginning and ending caps, with this window | |
| 98 | - // of pages in the middle providing a Google style sliding paginator setup. | |
| 99 | + // If we have enough room on both sides of the current page to build | |
| 100 | + // a slider we will surround it with both the beginning and | |
| 101 | + // ending caps, with this window of pages in the middle | |
| 102 | + // providing a Google style sliding paginator setup. | |
| 99 | 103 | return $this->getFullSlider($onEachSide); |
| 100 | 104 | } |
| 101 | 105 | |
| 102 | 106 | /** |