| Conditions | 11 |
| Paths | 80 |
| Total Lines | 29 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 107 | protected function renderButtons(): string |
||
| 108 | { |
||
| 109 | $result = ''; |
||
| 110 | |||
| 111 | // `Previous` page |
||
| 112 | $prevUrl = null!==$this->paginator && $this->paginator->isOnFirstPage() ? null : $this->getPageLink($this->currentPage - 1); |
||
| 113 | $result .= Html::openTag('li', ['class' => $prevUrl === null ? 'page-item disabled' : 'page-item']); |
||
| 114 | $result .= Html::a('Previous', $prevUrl, ['class' => 'page-link']); |
||
| 115 | $result .= Html::closeTag('li'); |
||
| 116 | |||
| 117 | // Numeric buttons |
||
| 118 | foreach ($this->pages as $page) { |
||
| 119 | $isDisabled = $this->currentPage === $page || $page === null; |
||
| 120 | $result .= Html::openTag('li', ['class' => $isDisabled ? 'page-item disabled' : 'page-item']); |
||
| 121 | if ($page === null) { |
||
| 122 | $result .= Html::span('…', ['class' => 'page-link']); |
||
| 123 | } else { |
||
| 124 | $result .= Html::a((string) $page, $this->getPageLink($page), ['class' => 'page-link']); |
||
| 125 | } |
||
| 126 | $result .= Html::closeTag('li'); |
||
| 127 | } |
||
| 128 | |||
| 129 | // `Next` page |
||
| 130 | $nextUrl = null!==$this->paginator && $this->paginator->isOnLastPage() ? null : $this->getPageLink($this->currentPage + 1); |
||
| 131 | $result .= Html::openTag('li', ['class' => $nextUrl === null ? 'page-item disabled' : 'page-item']); |
||
| 132 | $result .= Html::a('Next', $nextUrl, ['class' => 'page-link']); |
||
| 133 | $result .= Html::closeTag('li'); |
||
| 134 | |||
| 135 | return $result; |
||
| 136 | } |
||
| 150 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths