| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 59 | 
| Code Lines | 40 | 
| 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 | ||
| 44 | public function providerForBuildVersionInfo() | ||
| 45 |     { | ||
| 46 | return array( | ||
| 47 | array( | ||
| 48 | new SPIVersionInfo( | ||
| 49 | array( | ||
| 50 | 'status' => 44, | ||
| 51 | 'contentInfo' => new SPIContentInfo(), | ||
| 52 | ) | ||
| 53 | ), | ||
| 54 | array(), | ||
| 55 |                 array('status' => APIVersionInfo::STATUS_DRAFT), | ||
| 56 | ), | ||
| 57 | array( | ||
| 58 | new SPIVersionInfo( | ||
| 59 | array( | ||
| 60 | 'status' => SPIVersionInfo::STATUS_DRAFT, | ||
| 61 | 'contentInfo' => new SPIContentInfo(), | ||
| 62 | ) | ||
| 63 | ), | ||
| 64 | array(), | ||
| 65 |                 array('status' => APIVersionInfo::STATUS_DRAFT), | ||
| 66 | ), | ||
| 67 | array( | ||
| 68 | new SPIVersionInfo( | ||
| 69 | array( | ||
| 70 | 'status' => SPIVersionInfo::STATUS_PENDING, | ||
| 71 | 'contentInfo' => new SPIContentInfo(), | ||
| 72 | ) | ||
| 73 | ), | ||
| 74 | array(), | ||
| 75 |                 array('status' => APIVersionInfo::STATUS_DRAFT), | ||
| 76 | ), | ||
| 77 | array( | ||
| 78 | new SPIVersionInfo( | ||
| 79 | array( | ||
| 80 | 'status' => SPIVersionInfo::STATUS_ARCHIVED, | ||
| 81 | 'contentInfo' => new SPIContentInfo(), | ||
| 82 |                         'languageCodes' => array('eng-GB', 'nor-NB', 'fre-FR'), | ||
| 83 | ) | ||
| 84 | ), | ||
| 85 | array(1 => 'eng-GB', 3 => 'nor-NB', 5 => 'fre-FR'), | ||
| 86 | array( | ||
| 87 | 'status' => APIVersionInfo::STATUS_ARCHIVED, | ||
| 88 |                     'languageCodes' => array('eng-GB', 'nor-NB', 'fre-FR'), | ||
| 89 | ), | ||
| 90 | ), | ||
| 91 | array( | ||
| 92 | new SPIVersionInfo( | ||
| 93 | array( | ||
| 94 | 'status' => SPIVersionInfo::STATUS_PUBLISHED, | ||
| 95 | 'contentInfo' => new SPIContentInfo(), | ||
| 96 | ) | ||
| 97 | ), | ||
| 98 | array(), | ||
| 99 |                 array('status' => APIVersionInfo::STATUS_PUBLISHED), | ||
| 100 | ), | ||
| 101 | ); | ||
| 102 | } | ||
| 103 | |||
| 136 | 
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.