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