| Conditions | 1 |
| Paths | 1 |
| Total Lines | 196 |
| Code Lines | 129 |
| 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 |
||
| 46 | public static function processProvider(): Generator |
||
| 47 | { |
||
| 48 | yield 'Option has prefix but entity does not have prefix' => [ |
||
| 49 | [ |
||
| 50 | 'forward' => true, |
||
| 51 | 'seekable' => true, |
||
| 52 | 'limit' => 3, |
||
| 53 | 'orders' => [ |
||
| 54 | ['Posts.modified', 'ASC'], |
||
| 55 | ['Posts.id', 'ASC'], |
||
| 56 | ], |
||
| 57 | ], |
||
| 58 | [ |
||
| 59 | 'Posts.id' => 3, |
||
| 60 | 'Posts.modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 61 | ], |
||
| 62 | [ |
||
| 63 | new Entity([ |
||
| 64 | 'id' => 1, |
||
| 65 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 66 | ]), |
||
| 67 | new Entity([ |
||
| 68 | 'id' => 3, |
||
| 69 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 70 | ]), |
||
| 71 | new Entity([ |
||
| 72 | 'id' => 5, |
||
| 73 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 74 | ]), |
||
| 75 | new Entity([ |
||
| 76 | 'id' => 2, |
||
| 77 | 'modified' => new DateTime('2017-01-01 11:00:00'), |
||
| 78 | ]), |
||
| 79 | new Entity([ |
||
| 80 | 'id' => 4, |
||
| 81 | 'modified' => new DateTime('2017-01-01 11:00:00'), |
||
| 82 | ]), |
||
| 83 | ], |
||
| 84 | new PaginationResult( |
||
| 85 | [ |
||
| 86 | new Entity([ |
||
| 87 | 'id' => 3, |
||
| 88 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 89 | ]), |
||
| 90 | new Entity([ |
||
| 91 | 'id' => 5, |
||
| 92 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 93 | ]), |
||
| 94 | new Entity([ |
||
| 95 | 'id' => 2, |
||
| 96 | 'modified' => new DateTime('2017-01-01 11:00:00'), |
||
| 97 | ]), |
||
| 98 | ], [ |
||
| 99 | 'hasPrevious' => true, |
||
| 100 | 'previousCursor' => [ |
||
| 101 | 'Posts.id' => 1, |
||
| 102 | 'Posts.modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 103 | ], |
||
| 104 | 'hasNext' => true, |
||
| 105 | 'nextCursor' => [ |
||
| 106 | 'Posts.id' => 4, |
||
| 107 | 'Posts.modified' => new DateTime('2017-01-01 11:00:00'), |
||
| 108 | ], |
||
| 109 | 'limit' => 3, |
||
| 110 | ] |
||
| 111 | ), |
||
| 112 | ]; |
||
| 113 | |||
| 114 | yield 'Option and entity both do not have prefix' => [ |
||
| 115 | [ |
||
| 116 | 'forward' => true, |
||
| 117 | 'seekable' => true, |
||
| 118 | 'limit' => 3, |
||
| 119 | 'orders' => [ |
||
| 120 | ['modified', 'ASC'], |
||
| 121 | ['id', 'ASC'], |
||
| 122 | ], |
||
| 123 | ], |
||
| 124 | [ |
||
| 125 | 'id' => 3, |
||
| 126 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 127 | ], |
||
| 128 | [ |
||
| 129 | new Entity([ |
||
| 130 | 'id' => 1, |
||
| 131 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 132 | ]), |
||
| 133 | new Entity([ |
||
| 134 | 'id' => 3, |
||
| 135 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 136 | ]), |
||
| 137 | new Entity([ |
||
| 138 | 'id' => 5, |
||
| 139 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 140 | ]), |
||
| 141 | new Entity([ |
||
| 142 | 'id' => 2, |
||
| 143 | 'modified' => new DateTime('2017-01-01 11:00:00'), |
||
| 144 | ]), |
||
| 145 | new Entity([ |
||
| 146 | 'id' => 4, |
||
| 147 | 'modified' => new DateTime('2017-01-01 11:00:00'), |
||
| 148 | ]), |
||
| 149 | ], |
||
| 150 | new PaginationResult( |
||
| 151 | [ |
||
| 152 | new Entity([ |
||
| 153 | 'id' => 3, |
||
| 154 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 155 | ]), |
||
| 156 | new Entity([ |
||
| 157 | 'id' => 5, |
||
| 158 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 159 | ]), |
||
| 160 | new Entity([ |
||
| 161 | 'id' => 2, |
||
| 162 | 'modified' => new DateTime('2017-01-01 11:00:00'), |
||
| 163 | ]), |
||
| 164 | ], [ |
||
| 165 | 'hasPrevious' => true, |
||
| 166 | 'previousCursor' => [ |
||
| 167 | 'id' => 1, |
||
| 168 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 169 | ], |
||
| 170 | 'hasNext' => true, |
||
| 171 | 'nextCursor' => [ |
||
| 172 | 'id' => 4, |
||
| 173 | 'modified' => new DateTime('2017-01-01 11:00:00'), |
||
| 174 | ], |
||
| 175 | 'limit' => 3, |
||
| 176 | ] |
||
| 177 | ), |
||
| 178 | ]; |
||
| 179 | |||
| 180 | yield 'Option with prefix and without prefix exist and entity does not have prefix' => [ |
||
| 181 | [ |
||
| 182 | 'forward' => true, |
||
| 183 | 'seekable' => true, |
||
| 184 | 'limit' => 3, |
||
| 185 | 'orders' => [ |
||
| 186 | ['Posts.modified', 'ASC'], |
||
| 187 | ['id', 'ASC'], |
||
| 188 | ], |
||
| 189 | ], |
||
| 190 | [ |
||
| 191 | 'id' => 3, |
||
| 192 | 'Posts.modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 193 | ], |
||
| 194 | [ |
||
| 195 | new Entity([ |
||
| 196 | 'id' => 1, |
||
| 197 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 198 | ]), |
||
| 199 | new Entity([ |
||
| 200 | 'id' => 3, |
||
| 201 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 202 | ]), |
||
| 203 | new Entity([ |
||
| 204 | 'id' => 5, |
||
| 205 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 206 | ]), |
||
| 207 | new Entity([ |
||
| 208 | 'id' => 2, |
||
| 209 | 'modified' => new DateTime('2017-01-01 11:00:00'), |
||
| 210 | ]), |
||
| 211 | new Entity([ |
||
| 212 | 'id' => 4, |
||
| 213 | 'modified' => new DateTime('2017-01-01 11:00:00'), |
||
| 214 | ]), |
||
| 215 | ], |
||
| 216 | new PaginationResult( |
||
| 217 | [ |
||
| 218 | new Entity([ |
||
| 219 | 'id' => 3, |
||
| 220 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 221 | ]), |
||
| 222 | new Entity([ |
||
| 223 | 'id' => 5, |
||
| 224 | 'modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 225 | ]), |
||
| 226 | new Entity([ |
||
| 227 | 'id' => 2, |
||
| 228 | 'modified' => new DateTime('2017-01-01 11:00:00'), |
||
| 229 | ]), |
||
| 230 | ], [ |
||
| 231 | 'hasPrevious' => true, |
||
| 232 | 'previousCursor' => [ |
||
| 233 | 'id' => 1, |
||
| 234 | 'Posts.modified' => new DateTime('2017-01-01 10:00:00'), |
||
| 235 | ], |
||
| 236 | 'hasNext' => true, |
||
| 237 | 'nextCursor' => [ |
||
| 238 | 'id' => 4, |
||
| 239 | 'Posts.modified' => new DateTime('2017-01-01 11:00:00'), |
||
| 240 | ], |
||
| 241 | 'limit' => 3, |
||
| 242 | ] |
||
| 247 |
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