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