| Conditions | 1 |
| Paths | 1 |
| Total Lines | 65 |
| Code Lines | 36 |
| 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 |
||
| 26 | public function providerForPassTroughMethods() |
||
| 27 | { |
||
| 28 | $contentInfo = new ContentInfo(); |
||
| 29 | $versionInfo = new VersionInfo(); |
||
| 30 | $contentCreateStruct = new ContentCreateStruct(); |
||
| 31 | $contentUpdateStruct = new ContentUpdateStruct(); |
||
| 32 | $contentMetaStruct = new ContentMetadataUpdateStruct(); |
||
| 33 | $locationCreateStruct = new LocationCreateStruct(); |
||
| 34 | |||
| 35 | // string $method, array $arguments, bool $return = true |
||
| 36 | return [ |
||
| 37 | ['loadContentInfo', [42]], |
||
| 38 | |||
| 39 | ['loadContentInfoByRemoteId', ['f348tj4gorgji4']], |
||
| 40 | |||
| 41 | ['loadVersionInfo', [$contentInfo]], |
||
| 42 | ['loadVersionInfo', [$contentInfo, 3]], |
||
| 43 | |||
| 44 | ['loadVersionInfoById', [42]], |
||
| 45 | ['loadVersionInfoById', [42, 3]], |
||
| 46 | |||
| 47 | ['createContent', [$contentCreateStruct]], |
||
| 48 | ['createContent', [$contentCreateStruct, [44]]], |
||
| 49 | |||
| 50 | ['updateContentMetadata', [$contentInfo, $contentMetaStruct]], |
||
| 51 | |||
| 52 | ['deleteContent', [$contentInfo]], |
||
| 53 | |||
| 54 | ['createContentDraft', [$contentInfo]], |
||
| 55 | ['createContentDraft', [$contentInfo, $versionInfo]], |
||
| 56 | //['createContentDraft', [$contentInfo, $versionInfo, $user]], |
||
| 57 | |||
| 58 | ['loadContentDrafts', []], |
||
| 59 | //['loadContentDrafts', [$user]], |
||
| 60 | |||
| 61 | ['updateContent', [$versionInfo, $contentUpdateStruct]], |
||
| 62 | |||
| 63 | ['publishVersion', [$versionInfo]], |
||
| 64 | |||
| 65 | ['deleteVersion', [$versionInfo]], |
||
| 66 | |||
| 67 | ['loadVersions', [$contentInfo]], |
||
| 68 | |||
| 69 | ['copyContent', [$contentInfo, $locationCreateStruct]], |
||
| 70 | ['copyContent', [$contentInfo, $locationCreateStruct, $versionInfo]], |
||
| 71 | |||
| 72 | ['loadRelations', [$versionInfo]], |
||
| 73 | |||
| 74 | ['loadReverseRelations', [$contentInfo]], |
||
| 75 | |||
| 76 | ['addRelation', [$versionInfo, $contentInfo]], |
||
| 77 | |||
| 78 | ['deleteRelation', [$versionInfo, $contentInfo]], |
||
| 79 | |||
| 80 | ['removeTranslation', [$contentInfo, 'eng-GB']], |
||
| 81 | |||
| 82 | ['deleteTranslation', [$contentInfo, 'eng-GB']], |
||
| 83 | |||
| 84 | ['deleteTranslationFromDraft', [$versionInfo, 'eng-GB']], |
||
| 85 | |||
| 86 | //['newContentCreateStruct', [$contentType, 'eng-GB']], |
||
| 87 | ['newContentMetadataUpdateStruct', []], |
||
| 88 | ['newContentUpdateStruct', []], |
||
| 89 | ]; |
||
| 90 | } |
||
| 91 | |||
| 113 |