| Conditions | 1 |
| Paths | 1 |
| Total Lines | 56 |
| Code Lines | 38 |
| 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 |
||
| 10 | public function configDataProvider(): array |
||
| 11 | { |
||
| 12 | return [ |
||
| 13 | [ |
||
| 14 | 'empty', |
||
| 15 | [ |
||
| 16 | ], |
||
| 17 | [ |
||
| 18 | 'default_connection' => null, |
||
| 19 | 'default_serializer' => 'bdf', |
||
| 20 | 'failer' => 'memory:', |
||
| 21 | 'connections' => [], |
||
| 22 | 'destinations' => [], |
||
| 23 | ], |
||
| 24 | ], |
||
| 25 | [ |
||
| 26 | 'consumer options', |
||
| 27 | [ |
||
| 28 | 'destinations' => [ |
||
| 29 | 'foo' => [ |
||
| 30 | 'consumer' => [ |
||
| 31 | 'no_reset' => true, |
||
| 32 | 'retry' => 2, |
||
| 33 | 'max' => 3, |
||
| 34 | 'limit' => 4, |
||
| 35 | 'memory' => 128, |
||
| 36 | 'save' => true, |
||
| 37 | 'no_failure' => true, |
||
| 38 | 'stop_when_empty' => true, |
||
| 39 | 'auto_handle' => false, |
||
| 40 | ], |
||
| 41 | ], |
||
| 42 | ], |
||
| 43 | ], |
||
| 44 | [ |
||
| 45 | 'destinations' => [ |
||
| 46 | 'foo' => [ |
||
| 47 | 'consumer' => [ |
||
| 48 | 'no_reset' => true, |
||
| 49 | 'retry' => 2, |
||
| 50 | 'max' => 3, |
||
| 51 | 'limit' => 4, |
||
| 52 | 'memory' => 128, |
||
| 53 | 'save' => true, |
||
| 54 | 'no_failure' => true, |
||
| 55 | 'stop_when_empty' => true, |
||
| 56 | 'auto_handle' => false, |
||
| 57 | 'handler' => null, |
||
| 58 | 'middlewares' => [], |
||
| 59 | ], |
||
| 60 | ], |
||
| 61 | ], |
||
| 62 | 'default_connection' => null, |
||
| 63 | 'default_serializer' => 'bdf', |
||
| 64 | 'failer' => 'memory:', |
||
| 65 | 'connections' => [], |
||
| 66 | ], |
||
| 83 |