Conditions | 1 |
Paths | 1 |
Total Lines | 76 |
Code Lines | 73 |
Lines | 0 |
Ratio | 0 % |
Changes | 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 |
||
47 | public function providerForTestHttpOptions(): array |
||
48 | { |
||
49 | return [ |
||
50 | ['/', ['GET']], |
||
51 | ['/content/sections', ['GET', 'POST']], |
||
52 | ['/content/sections/1', ['GET', 'PATCH', 'DELETE']], |
||
53 | ['/content/objects', ['GET', 'POST']], |
||
54 | ['/content/objects/1', ['PATCH', 'GET', 'DELETE', 'COPY']], |
||
55 | ['/content/objects/1/translations/eng-GB', ['DELETE']], |
||
56 | ['/content/objects/1/relations', ['GET']], |
||
57 | ['/content/objects/1/versions', ['GET']], |
||
58 | ['/content/objects/1/versions/1/relations', ['GET', 'POST']], |
||
59 | ['/content/objects/1/versions/1/relations/1', ['GET', 'DELETE']], |
||
60 | ['/content/objects/1/versions/1', ['GET', 'PATCH', 'DELETE', 'COPY', 'PUBLISH']], |
||
61 | ['/content/objects/1/versions/1/translations/eng-GB', ['DELETE']], |
||
62 | ['/content/objects/1/currentversion', ['GET', 'COPY']], |
||
63 | ['/content/binary/images/1-2-3/variations/123', ['GET']], |
||
64 | ['/content/views', ['POST']], |
||
65 | ['/views', ['POST', 'GET']], |
||
66 | ['/views/1', ['GET']], |
||
67 | ['/views/1/results', ['GET']], |
||
68 | ['/content/objectstategroups', ['GET', 'POST']], |
||
69 | ['/content/objectstategroups/1', ['GET', 'PATCH', 'DELETE']], |
||
70 | ['/content/objectstategroups/1/objectstates', ['GET', 'POST']], |
||
71 | ['/content/objectstategroups/1/objectstates/1', ['GET', 'PATCH', 'DELETE']], |
||
72 | ['/content/objects/1/objectstates', ['GET', 'PATCH']], |
||
73 | ['/content/locations', ['GET']], |
||
74 | ['/content/locations/1/2', ['GET', 'PATCH', 'DELETE', 'COPY', 'MOVE', 'SWAP']], |
||
75 | ['/content/locations/1/2/children', ['GET']], |
||
76 | ['/content/objects/1/locations', ['GET', 'POST']], |
||
77 | ['/content/typegroups', ['GET', 'POST']], |
||
78 | ['/content/typegroups/1', ['GET', 'PATCH', 'DELETE']], |
||
79 | ['/content/typegroups/1/types', ['GET', 'POST']], |
||
80 | ['/content/types', ['GET']], |
||
81 | ['/content/types/1', ['COPY', 'GET', 'POST', 'DELETE']], |
||
82 | ['/content/types/1/draft', ['DELETE', 'GET', 'PATCH', 'PUBLISH']], |
||
83 | ['/content/types/1/fieldDefinitions', ['GET']], |
||
84 | ['/content/types/1/fieldDefinitions/1', ['GET']], |
||
85 | ['/content/types/1/draft/fieldDefinitions', ['GET', 'POST']], |
||
86 | ['/content/types/1/draft/fieldDefinitions/1', ['GET', 'PATCH', 'DELETE']], |
||
87 | ['/content/types/1/groups', ['GET', 'POST']], |
||
88 | ['/content/types/1/groups/1', ['DELETE']], |
||
89 | ['/content/trash', ['GET', 'DELETE']], |
||
90 | ['/content/trash/1', ['GET', 'DELETE', 'MOVE']], |
||
91 | ['/content/urlwildcards', ['GET', 'POST']], |
||
92 | ['/content/urlwildcards/1', ['GET', 'DELETE']], |
||
93 | ['/user/policies', ['GET']], |
||
94 | ['/user/roles', ['GET', 'POST']], |
||
95 | ['/user/roles/1', ['POST', 'GET', 'PATCH', 'DELETE']], |
||
96 | ['/user/roles/1/draft', ['GET', 'PATCH', 'PUBLISH', 'DELETE']], |
||
97 | ['/user/roles/1/policies', ['GET', 'POST', 'DELETE']], |
||
98 | ['/user/roles/1/policies/328', ['GET', 'PATCH', 'DELETE']], |
||
99 | ['/user/users', ['HEAD', 'GET']], |
||
100 | ['/user/users/10', ['GET', 'PATCH', 'DELETE']], |
||
101 | ['/user/users/10/groups', ['GET', 'POST']], |
||
102 | ['/user/users/10/groups/4', ['DELETE']], |
||
103 | ['/user/users/10/drafts', ['GET']], |
||
104 | ['/user/users/10/roles', ['GET', 'POST']], |
||
105 | ['/user/users/10/roles/1', ['GET', 'DELETE']], |
||
106 | ['/user/groups', ['GET']], |
||
107 | ['/user/groups/root', ['GET']], |
||
108 | ['/user/groups/subgroups', ['POST']], |
||
109 | ['/user/groups/4', ['GET', 'PATCH', 'DELETE', 'MOVE']], |
||
110 | ['/user/groups/4/subgroups', ['GET', 'POST']], |
||
111 | ['/user/groups/4/users', ['GET', 'POST']], |
||
112 | ['/user/groups/4/roles', ['GET', 'POST']], |
||
113 | ['/user/groups/13/roles/1', ['GET', 'DELETE']], |
||
114 | ['/user/sessions', ['POST']], |
||
115 | ['/user/sessions/sess_123', ['DELETE']], |
||
116 | ['/user/sessions/sess_123/refresh', ['POST']], |
||
117 | ['/content/urlaliases', ['GET', 'POST']], |
||
118 | ['/content/locations/1/2/urlaliases', ['GET']], |
||
119 | ['/content/urlaliases/12', ['GET', 'DELETE']], |
||
120 | ['/services/countries', ['GET']], |
||
121 | ]; |
||
122 | } |
||
123 | } |
||
124 |