| Total Complexity | 11 |
| Total Lines | 72 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class ComplexCategory extends Category |
||
| 10 | { |
||
| 11 | private static $table_name = 'ComplexCategory'; |
||
| 12 | |||
| 13 | private static $description = "A category that allows sorting and limiting of products"; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Get the current search query from the current request |
||
| 17 | * |
||
| 18 | * @return array |
||
| 19 | */ |
||
| 20 | public function getQuery() |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Return the current option from the URL |
||
| 33 | * |
||
| 34 | * @param array $options An array of options to check |
||
| 35 | * @param string $type Either "sort" or "limit" |
||
| 36 | * |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | public function getCurrentOption($options, $type = "sort") |
||
| 40 | { |
||
| 41 | $query = $this->getQuery(); |
||
| 42 | $return = ""; |
||
| 43 | |||
| 44 | if (isset($query[$type])) { |
||
| 45 | $i = 0; |
||
| 46 | foreach ($options as $key => $value) { |
||
| 47 | if ($query[$type] == $i |
||
| 48 | && $key != ComplexCategoryController::DEFAULT_SORT) { |
||
| 49 | $return = $key; |
||
| 50 | break; |
||
| 51 | } |
||
| 52 | $i++; |
||
| 53 | } |
||
| 54 | } |
||
| 55 | |||
| 56 | return $return; |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Get a list of all products from this category and it's children |
||
| 61 | * categories. |
||
| 62 | * |
||
| 63 | * @return ArrayList |
||
| 64 | */ |
||
| 65 | public function AllProducts($sort = []) |
||
| 81 | } |
||
| 82 | } |
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