Conditions | 1 |
Paths | 1 |
Total Lines | 73 |
Code Lines | 52 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
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 |
||
41 | #[ |
||
42 | Get( |
||
43 | path: "/tags", |
||
44 | operationId: "tagGetAllWithFilter", |
||
45 | description: "Get all tags with pagination (10 items per page by default, page 1 by default, page 1 by default) |
||
46 | This API will get records from the database and return them as a paginated list. |
||
47 | The default number of items per page is 10 and the default page number is 1. You can change these values by passing the `per_page` and `page` query parameters. |
||
48 | ", |
||
49 | summary: "Get all tags with pagination", |
||
50 | security: [['sanctum' => []]], |
||
51 | tags: ["Tag"], |
||
52 | parameters: [ |
||
53 | new Parameter( |
||
54 | name: 'per_page', |
||
55 | description: 'Number of items per page', |
||
56 | in: 'query', |
||
57 | required: false, |
||
58 | schema: new Schema(type: 'integer', default: 10) |
||
59 | ), |
||
60 | new Parameter( |
||
61 | name: 'page', |
||
62 | description: 'Page number', |
||
63 | in: 'query', |
||
64 | required: false, |
||
65 | schema: new Schema(type: 'integer', default: 1) |
||
66 | ), |
||
67 | ], |
||
68 | responses: [ |
||
69 | new Response( |
||
70 | response: 200, |
||
71 | description: "Get tags successfully", |
||
72 | content: new JsonContent( |
||
73 | properties: [ |
||
74 | new Property( |
||
75 | property: 'error', |
||
76 | description: 'Error status', |
||
77 | type: 'boolean', |
||
78 | default: false |
||
79 | ), |
||
80 | new Property( |
||
81 | property: 'data', |
||
82 | description: 'Data', |
||
83 | properties: [ |
||
84 | new Property( |
||
85 | property: 'tag', |
||
86 | ref: TagModelResourceSchema::class, |
||
87 | description: 'Tag', |
||
88 | type: 'object' |
||
89 | ), |
||
90 | ], |
||
91 | type: 'object' |
||
92 | ), |
||
93 | ] |
||
94 | ) |
||
95 | ), |
||
96 | new Response( |
||
97 | ref: BadRequestResponseSchema::class, |
||
98 | response: 400, |
||
99 | ), |
||
100 | new Response( |
||
101 | ref: ErrorNotFoundResponseSchema::class, |
||
102 | response: 404, |
||
103 | ), |
||
104 | new Response( |
||
105 | ref: InternalServerResponseSchema::class, |
||
106 | response: 500, |
||
107 | ), |
||
108 | ] |
||
109 | ) |
||
110 | ] |
||
111 | public function index(Request $request): BaseHttpResponse|JsonResponse|JsonResource|RedirectResponse |
||
112 | { |
||
113 | return parent::index($request); |
||
114 | } |
||
217 |
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