@@ -96,12 +96,12 @@ |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | return '<ul class="pagination">' . |
| 99 | - $this->_renderListItem($this->_currentPage - 1, $this->_getFirstPageUrl(), $this->_firstPageSymbol) . |
|
| 100 | - $this->_renderListItem($this->_currentPage - 1, $this->_getPreviousPageUrl(), $this->_previousPageSymbol) . |
|
| 101 | - $this->_renderPageList() . |
|
| 102 | - $this->_renderListItem($this->_currentPage + 1, $this->_getNextPageUrl(), $this->_nextPageSymbol) . |
|
| 103 | - $this->_renderListItem($this->_currentPage + 1, $this->_getLastPageUrl(), $this->_lastPageSymbol) . |
|
| 104 | - '</ul>'; |
|
| 99 | + $this->_renderListItem($this->_currentPage - 1, $this->_getFirstPageUrl(), $this->_firstPageSymbol) . |
|
| 100 | + $this->_renderListItem($this->_currentPage - 1, $this->_getPreviousPageUrl(), $this->_previousPageSymbol) . |
|
| 101 | + $this->_renderPageList() . |
|
| 102 | + $this->_renderListItem($this->_currentPage + 1, $this->_getNextPageUrl(), $this->_nextPageSymbol) . |
|
| 103 | + $this->_renderListItem($this->_currentPage + 1, $this->_getLastPageUrl(), $this->_lastPageSymbol) . |
|
| 104 | + '</ul>'; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * @return null|string |
| 128 | 128 | * @throws \RuntimeException |
| 129 | 129 | */ |
| 130 | - private function _getFirstPageUrl() : ?string |
|
| 130 | + private function _getFirstPageUrl() : ? string |
|
| 131 | 131 | { |
| 132 | 132 | if ($this->_currentPage <= $this->_surroundingPages + 1) |
| 133 | 133 | { |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @return null|string |
| 158 | 158 | * @throws \RuntimeException |
| 159 | 159 | */ |
| 160 | - private function _getPreviousPageUrl() : ?string |
|
| 160 | + private function _getPreviousPageUrl() : ? string |
|
| 161 | 161 | { |
| 162 | 162 | $previousPage = $this->_currentPage - 1; |
| 163 | 163 | if ($previousPage < 1) |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $end = $this->_getEndPage(); |
| 180 | 180 | |
| 181 | 181 | $pageList = ''; |
| 182 | - for ($i = $this->_getStartPage(); $i <= $end; $i ++) |
|
| 182 | + for ($i = $this->_getStartPage(); $i <= $end; $i++) |
|
| 183 | 183 | { |
| 184 | 184 | $pageList .= $this->_renderListItem($i, $this->_buildPageUrl($i)); |
| 185 | 185 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | * @return null|string |
| 232 | 232 | * @throws \RuntimeException |
| 233 | 233 | */ |
| 234 | - private function _getNextPageUrl() : ?string |
|
| 234 | + private function _getNextPageUrl() : ? string |
|
| 235 | 235 | { |
| 236 | 236 | if ($this->_currentPage >= $this->pageCount()) |
| 237 | 237 | { |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | * @return null|string |
| 246 | 246 | * @throws \RuntimeException |
| 247 | 247 | */ |
| 248 | - private function _getLastPageUrl() : ?string |
|
| 248 | + private function _getLastPageUrl() : ? string |
|
| 249 | 249 | { |
| 250 | 250 | $lastPage = $this->pageCount(); |
| 251 | 251 | if ($this->_currentPage + $this->_surroundingPages >= $lastPage) |
@@ -254,9 +254,9 @@ |
||
| 254 | 254 | $this->_initColumns(); |
| 255 | 255 | |
| 256 | 256 | return TableRenderer::open($this->_classes) . |
| 257 | - TableRenderer::renderHeaders($this->_fetchHeaders(), $this->_headerFormatters) . |
|
| 258 | - TableRenderer::renderBody($data, $this->_columns) . |
|
| 259 | - TableRenderer::close(); |
|
| 257 | + TableRenderer::renderHeaders($this->_fetchHeaders(), $this->_headerFormatters) . |
|
| 258 | + TableRenderer::renderBody($data, $this->_columns) . |
|
| 259 | + TableRenderer::close(); |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use hamburgscleanest\DataTables\Facades\SessionHelper; |
| 6 | 6 | use Illuminate\Database\Eloquent\Builder; |
| 7 | -use Illuminate\Http\Request; |
|
| 8 | 7 | |
| 9 | 8 | /** |
| 10 | 9 | * Class DataComponent |
@@ -38,7 +38,6 @@ |
||
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * @param array $headerFormatters |
| 41 | - * @param Request $request |
|
| 42 | 41 | * @return Header |
| 43 | 42 | */ |
| 44 | 43 | public function formatArray(array $headerFormatters) : Header |
@@ -30,7 +30,6 @@ |
||
| 30 | 30 | * For example add a link to sort by this header/column. |
| 31 | 31 | * |
| 32 | 32 | * @param Header $header |
| 33 | - * @param Request $request |
|
| 34 | 33 | */ |
| 35 | 34 | public function format(Header $header) : void |
| 36 | 35 | { |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | if ($this->_showSortLink($headerAttributeName)) |
| 113 | 113 | { |
| 114 | 114 | $header->key = '<a class="sortable-header" href="' . (\request()->url() . '?' . $this->_buildSortQuery($headerAttributeName, $direction)) . '">' . |
| 115 | - $header->key . ' <span class="sort-symbol">' . ($this->_sortingSymbols[$direction] ?? '') . '</span></a>'; |
|
| 115 | + $header->key . ' <span class="sort-symbol">' . ($this->_sortingSymbols[$direction] ?? '') . '</span></a>'; |
|
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | * @return string |
| 167 | 167 | * @throws \RuntimeException |
| 168 | 168 | */ |
| 169 | - private function _buildSortQuery(string $columnName, string &$oldDirection) : string |
|
| 169 | + private function _buildSortQuery(string $columnName, string & $oldDirection) : string |
|
| 170 | 170 | { |
| 171 | 171 | $parameters = UrlHelper::queryParameters(); |
| 172 | 172 | if (!isset($parameters['sort'])) |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | * @param string $queryString |
| 190 | 190 | * @return null|string |
| 191 | 191 | */ |
| 192 | - private function _getDirectionFromQuery(string $columnName, string $queryString) : ?string |
|
| 192 | + private function _getDirectionFromQuery(string $columnName, string $queryString) : ? string |
|
| 193 | 193 | { |
| 194 | 194 | $column = $columnName . self::SORTING_SEPARATOR; |
| 195 | 195 | $columnPos = \mb_strpos($queryString, $column); |
@@ -120,9 +120,9 @@ |
||
| 120 | 120 | public function render() : string |
| 121 | 121 | { |
| 122 | 122 | return '<form method="get" action="' . $this->_buildSearchUrl() . |
| 123 | - '"><div class="row"><div class="col-md-10"><input name="search" class="form-control data-scout-input" placeholder="' . |
|
| 124 | - $this->_placeholder . '"/></div><div class="col-md-2"><button type="submit" class="btn btn-primary">' . |
|
| 125 | - $this->_buttonText . '</button></div></div></form>'; |
|
| 123 | + '"><div class="row"><div class="col-md-10"><input name="search" class="form-control data-scout-input" placeholder="' . |
|
| 124 | + $this->_placeholder . '"/></div><div class="col-md-2"><button type="submit" class="btn btn-primary">' . |
|
| 125 | + $this->_buttonText . '</button></div></div></form>'; |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |