| Conditions | 3 |
| Paths | 3 |
| Total Lines | 32 |
| Code Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 33 | public function findBySlug(string $slug) |
||
| 34 | { |
||
| 35 | /** @var Slug $slug */ |
||
| 36 | $slug = SlugHelper::getSlug($slug, SlugHelper::getPrefix(Tag::class)); |
||
| 37 | if (!$slug) { |
||
| 38 | return $this |
||
| 39 | ->httpResponse() |
||
| 40 | ->setError() |
||
| 41 | ->setCode(404) |
||
| 42 | ->setMessage('Not found'); |
||
| 43 | } |
||
| 44 | |||
| 45 | $tag = Tag::query() |
||
| 46 | ->with('slugable') |
||
| 47 | ->where([ |
||
| 48 | 'id' => $slug->reference_id, |
||
| 49 | 'status' => StatusEnum::PUBLISHED, |
||
| 50 | ]) |
||
| 51 | ->first(); |
||
| 52 | |||
| 53 | if (!$tag) { |
||
| 54 | return $this |
||
| 55 | ->httpResponse() |
||
| 56 | ->setError() |
||
| 57 | ->setCode(404) |
||
| 58 | ->setMessage('Not found'); |
||
| 59 | } |
||
| 60 | |||
| 61 | return $this |
||
| 62 | ->httpResponse() |
||
| 63 | ->setData(new TagResource($tag)) |
||
| 64 | ->toApiResponse(); |
||
| 65 | } |
||
| 67 |
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