| Conditions | 1 |
| Paths | 1 |
| Total Lines | 53 |
| Code Lines | 39 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 6 | ||
| 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 |
||
| 27 | public function validInputProvider() { |
||
| 28 | return array( |
||
| 29 | array( |
||
| 30 | 'Douglas Adams', |
||
| 31 | array( |
||
| 32 | new EntityIdValue(new ItemId('Q42')), |
||
| 33 | new EntityIdValue(new ItemId('Q21454969')), |
||
| 34 | new EntityIdValue(new ItemId('Q25212461')) |
||
| 35 | ) |
||
| 36 | ), |
||
| 37 | array( |
||
| 38 | 'Barack Obama', |
||
| 39 | array(new EntityIdValue(new ItemId('Q76'))) |
||
| 40 | ), |
||
| 41 | array( |
||
| 42 | 'P=NP', |
||
| 43 | array(new EntityIdValue(new ItemId('Q746242'))) |
||
| 44 | ), |
||
| 45 | array( |
||
| 46 | 'TUNGSTÈNE', |
||
| 47 | array( |
||
| 48 | new EntityIdValue(new ItemId('Q743')), |
||
| 49 | new EntityIdValue(new ItemId('Q3542087')) |
||
| 50 | ) |
||
| 51 | ), |
||
| 52 | array( |
||
| 53 | 'Barack Obama', |
||
| 54 | array(new EntityIdValue(new ItemId('Q76'))) |
||
| 55 | ), |
||
| 56 | array( |
||
| 57 | '', |
||
| 58 | array() |
||
| 59 | ), |
||
| 60 | array( |
||
| 61 | 'abcabcabc', |
||
| 62 | array() |
||
| 63 | ), |
||
| 64 | array( |
||
| 65 | 'q42', |
||
| 66 | array(new EntityIdValue(new ItemId('Q42'))) |
||
| 67 | ), |
||
| 68 | array( |
||
| 69 | 'VIAF', |
||
| 70 | array(new EntityIdValue(new PropertyId('P214'))), |
||
| 71 | $this->getInstance('property') |
||
| 72 | ), |
||
| 73 | array( |
||
| 74 | 'P214', |
||
| 75 | array(new EntityIdValue(new PropertyId('P214'))), |
||
| 76 | $this->getInstance('property') |
||
| 77 | ), |
||
| 78 | ); |
||
| 79 | } |
||
| 80 | |||
| 121 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.