| Conditions | 3 |
| Paths | 3 |
| Total Lines | 32 |
| Code Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function findBySlug(string $slug) |
||
| 20 | { |
||
| 21 | $slug = SlugHelper::getSlug($slug, SlugHelper::getPrefix(Category::getBaseModel())); |
||
| 22 | |||
| 23 | if (! $slug) { |
||
| 24 | return $this |
||
| 25 | ->httpResponse() |
||
| 26 | ->setError() |
||
| 27 | ->setCode(404) |
||
| 28 | ->setMessage('Not found'); |
||
| 29 | } |
||
| 30 | |||
| 31 | $category = Category::query() |
||
| 32 | ->with('slugable') |
||
| 33 | ->where([ |
||
| 34 | 'id' => $slug->reference_id, |
||
| 35 | 'status' => StatusEnum::PUBLISHED, |
||
| 36 | ]) |
||
| 37 | ->first(); |
||
| 38 | |||
| 39 | if (! $category) { |
||
| 40 | return $this |
||
| 41 | ->httpResponse() |
||
| 42 | ->setError() |
||
| 43 | ->setCode(404) |
||
| 44 | ->setMessage('Not found'); |
||
| 45 | } |
||
| 46 | |||
| 47 | return $this |
||
| 48 | ->httpResponse() |
||
| 49 | ->setData(new ListCategoryResource($category)) |
||
| 50 | ->toApiResponse(); |
||
| 51 | } |
||
| 53 |
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