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