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 | 1 | ||
| 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 |
||
| 85 | public function testCustomBuilders() |
||
| 86 | { |
||
| 87 | $ext = new OverblogGraphQLExtension(); |
||
| 88 | $ext->load( |
||
| 89 | [ |
||
| 90 | [ |
||
| 91 | 'definitions' => [ |
||
| 92 | 'builders' => [ |
||
| 93 | 'field' => [ |
||
| 94 | [ |
||
| 95 | 'alias' => 'RawId', |
||
| 96 | 'class' => 'Overblog\\GraphQLBundle\\Tests\\DependencyInjection\\Builder\\RawIdField', |
||
| 97 | ], |
||
| 98 | ], |
||
| 99 | 'args' => [ |
||
| 100 | [ |
||
| 101 | 'alias' => 'Pager', |
||
| 102 | 'class' => 'Overblog\\GraphQLBundle\\Tests\\DependencyInjection\\Builder\\PagerArgs', |
||
| 103 | ], |
||
| 104 | ], |
||
| 105 | ], |
||
| 106 | ], |
||
| 107 | ], |
||
| 108 | ], |
||
| 109 | $this->container |
||
| 110 | ); |
||
| 111 | |||
| 112 | $this->extension->load( |
||
| 113 | [ |
||
| 114 | [ |
||
| 115 | 'foo' => [ |
||
| 116 | 'type' => 'object', |
||
| 117 | 'config' => [ |
||
| 118 | 'fields' => [ |
||
| 119 | 'rawIDWithDescriptionOverride' => [ |
||
| 120 | 'builder' => 'RawId', |
||
| 121 | 'description' => 'rawIDWithDescriptionOverride description', |
||
| 122 | ], |
||
| 123 | 'rawID' => 'RawId', |
||
| 124 | 'rawIDs' => [ |
||
| 125 | 'type' => '[RawID!]!', |
||
| 126 | 'argsBuilder' => 'Pager', |
||
| 127 | ], |
||
| 128 | 'categories' => [ |
||
| 129 | 'type' => '[String!]!', |
||
| 130 | 'argsBuilder' => ['builder' => 'Pager'], |
||
| 131 | ], |
||
| 132 | ], |
||
| 133 | ], |
||
| 134 | ], |
||
| 135 | ], |
||
| 136 | ], |
||
| 137 | $this->container |
||
| 138 | ); |
||
| 139 | |||
| 140 | $this->assertEquals( |
||
| 141 | [ |
||
| 142 | 'foo' => [ |
||
| 143 | 'type' => 'object', |
||
| 144 | 'config' => [ |
||
| 145 | 'name' => 'foo', |
||
| 146 | 'fields' => [ |
||
| 147 | 'rawIDWithDescriptionOverride' => [ |
||
| 148 | 'description' => 'rawIDWithDescriptionOverride description', |
||
| 149 | 'type' => 'Int!', |
||
| 150 | 'resolve' => '@=value.id', |
||
| 151 | 'args' => [], |
||
| 152 | ], |
||
| 153 | 'rawID' => [ |
||
| 154 | 'description' => 'The raw ID of an object', |
||
| 155 | 'type' => 'Int!', |
||
| 156 | 'resolve' => '@=value.id', |
||
| 157 | 'args' => [], |
||
| 158 | ], |
||
| 159 | 'rawIDs' => [ |
||
| 160 | 'type' => '[RawID!]!', |
||
| 161 | 'args' => [ |
||
| 162 | 'limit' => [ |
||
| 163 | 'type' => 'Int!', |
||
| 164 | 'defaultValue' => 20, |
||
| 165 | ], |
||
| 166 | 'offset' => [ |
||
| 167 | 'type' => 'Int!', |
||
| 168 | 'defaultValue' => 0, |
||
| 169 | ], |
||
| 170 | ], |
||
| 171 | ], |
||
| 172 | 'categories' => [ |
||
| 173 | 'type' => '[String!]!', |
||
| 174 | 'args' => [ |
||
| 175 | 'limit' => [ |
||
| 176 | 'type' => 'Int!', |
||
| 177 | 'defaultValue' => 20, |
||
| 178 | ], |
||
| 179 | 'offset' => [ |
||
| 180 | 'type' => 'Int!', |
||
| 181 | 'defaultValue' => 0, |
||
| 182 | ], |
||
| 183 | ], |
||
| 184 | ], |
||
| 185 | ], |
||
| 186 | 'interfaces' => [], |
||
| 187 | ], |
||
| 188 | ], |
||
| 189 | |||
| 190 | ], |
||
| 191 | $this->container->getParameter('overblog_graphql_types.config') |
||
| 192 | ); |
||
| 193 | } |
||
| 194 | |||
| 224 |