| Conditions | 1 |
| Paths | 1 |
| Total Lines | 60 |
| Code Lines | 37 |
| 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 |
||
| 42 | public function dataProviderPropertyNotThingableException() : array |
||
| 43 | { |
||
| 44 | return [ |
||
| 45 | [ |
||
| 46 | ReadWriteJsonJsonArrayBad::class, |
||
| 47 | ReadWriteJsonJsonArrayBad::class, |
||
| 48 | 'json', |
||
| 49 | PropertyNotNullableException::class, |
||
| 50 | 'nullable', |
||
| 51 | [ |
||
| 52 | 'json' => null, |
||
| 53 | ], |
||
| 54 | true, |
||
| 55 | ], |
||
| 56 | [ |
||
| 57 | ReadWriteJsonJsonArray::class, |
||
| 58 | ReadWriteJsonJsonArray::class, |
||
| 59 | 'notthere', |
||
| 60 | PropertyNotJsonDecodableException::class, |
||
| 61 | 'json-decodable', |
||
| 62 | [ |
||
| 63 | 'json' => [], |
||
| 64 | 'notthere' => 1, |
||
| 65 | ], |
||
| 66 | true, |
||
| 67 | ], |
||
| 68 | [ |
||
| 69 | ReadWriteJsonJsonArray::class, |
||
| 70 | ReadWriteJsonJsonArray::class, |
||
| 71 | 'json', |
||
| 72 | PropertyNotJsonDecodableShouldBeArrayException::class, |
||
| 73 | 'json-decodable (should be an array)', |
||
| 74 | [ |
||
| 75 | 'json' => 1, |
||
| 76 | ], |
||
| 77 | true, |
||
| 78 | ], |
||
| 79 | [ |
||
| 80 | ReadWriteJsonJson::class, |
||
| 81 | ReadWriteJson::class, |
||
| 82 | 'json', |
||
| 83 | PropertyNotJsonDecodableShouldBeArrayException::class, |
||
| 84 | 'json-decodable (should be an array)', |
||
| 85 | [ |
||
| 86 | 'json' => 1, |
||
| 87 | ], |
||
| 88 | true, |
||
| 89 | ], |
||
| 90 | [ |
||
| 91 | ReadWriteJsonJsonArray::class, |
||
| 92 | ReadWriteJson::class, |
||
| 93 | 'json', |
||
| 94 | PropertyNotJsonDecodableShouldBeArrayException::class, |
||
| 95 | 'json-decodable (should be an array)', |
||
| 96 | [ |
||
| 97 | 'json' => [ |
||
| 98 | 1, |
||
| 99 | ], |
||
| 100 | ], |
||
| 101 | true, |
||
| 102 | ], |
||
| 156 |