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