We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 1 |
Paths | 1 |
Total Lines | 109 |
Code Lines | 64 |
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 |
||
118 | public function testCustomBuilders() |
||
119 | { |
||
120 | $ext = new OverblogGraphQLExtension(); |
||
121 | $ext->load( |
||
122 | [ |
||
123 | [ |
||
124 | 'definitions' => [ |
||
125 | 'builders' => [ |
||
126 | 'field' => [ |
||
127 | [ |
||
128 | 'alias' => 'RawId', |
||
129 | 'class' => 'Overblog\\GraphQLBundle\\Tests\\DependencyInjection\\Builder\\RawIdField', |
||
130 | ], |
||
131 | ], |
||
132 | 'args' => [ |
||
133 | [ |
||
134 | 'alias' => 'Pager', |
||
135 | 'class' => 'Overblog\\GraphQLBundle\\Tests\\DependencyInjection\\Builder\\PagerArgs', |
||
136 | ], |
||
137 | ], |
||
138 | ], |
||
139 | ], |
||
140 | ], |
||
141 | ], |
||
142 | $this->container |
||
143 | ); |
||
144 | |||
145 | $this->extension->load( |
||
146 | [ |
||
147 | [ |
||
148 | 'foo' => [ |
||
149 | 'type' => 'object', |
||
150 | 'config' => [ |
||
151 | 'fields' => [ |
||
152 | 'rawIDWithDescriptionOverride' => [ |
||
153 | 'builder' => 'RawId', |
||
154 | 'description' => 'rawIDWithDescriptionOverride description', |
||
155 | ], |
||
156 | 'rawID' => 'RawId', |
||
157 | 'rawIDs' => [ |
||
158 | 'type' => '[RawID!]!', |
||
159 | 'argsBuilder' => 'Pager', |
||
160 | ], |
||
161 | 'categories' => [ |
||
162 | 'type' => '[String!]!', |
||
163 | 'argsBuilder' => ['builder' => 'Pager'], |
||
164 | ], |
||
165 | ], |
||
166 | ], |
||
167 | ], |
||
168 | ], |
||
169 | ], |
||
170 | $this->container |
||
171 | ); |
||
172 | |||
173 | $this->assertEquals( |
||
174 | [ |
||
175 | 'foo' => [ |
||
176 | 'type' => 'object', |
||
177 | 'config' => [ |
||
178 | 'name' => 'foo', |
||
179 | 'fields' => [ |
||
180 | 'rawIDWithDescriptionOverride' => [ |
||
181 | 'description' => 'rawIDWithDescriptionOverride description', |
||
182 | 'type' => 'Int!', |
||
183 | 'resolve' => '@=value.id', |
||
184 | 'args' => [], |
||
185 | ], |
||
186 | 'rawID' => [ |
||
187 | 'description' => 'The raw ID of an object', |
||
188 | 'type' => 'Int!', |
||
189 | 'resolve' => '@=value.id', |
||
190 | 'args' => [], |
||
191 | ], |
||
192 | 'rawIDs' => [ |
||
193 | 'type' => '[RawID!]!', |
||
194 | 'args' => [ |
||
195 | 'limit' => [ |
||
196 | 'type' => 'Int!', |
||
197 | 'defaultValue' => 20, |
||
198 | ], |
||
199 | 'offset' => [ |
||
200 | 'type' => 'Int!', |
||
201 | 'defaultValue' => 0, |
||
202 | ], |
||
203 | ], |
||
204 | ], |
||
205 | 'categories' => [ |
||
206 | 'type' => '[String!]!', |
||
207 | 'args' => [ |
||
208 | 'limit' => [ |
||
209 | 'type' => 'Int!', |
||
210 | 'defaultValue' => 20, |
||
211 | ], |
||
212 | 'offset' => [ |
||
213 | 'type' => 'Int!', |
||
214 | 'defaultValue' => 0, |
||
215 | ], |
||
216 | ], |
||
217 | ], |
||
218 | ], |
||
219 | 'interfaces' => [], |
||
220 | ], |
||
221 | ], |
||
222 | |||
223 | ], |
||
224 | $this->container->getParameter('overblog_graphql_types.config') |
||
225 | ); |
||
226 | } |
||
227 | |||
257 |