Conditions | 1 |
Paths | 1 |
Total Lines | 53 |
Code Lines | 35 |
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 |
||
38 | public function build(): array |
||
39 | { |
||
40 | $webComponentsConfig = $this->webComponentsConfig; |
||
41 | $twigConfigTransformer = $this->configToTwigConfigTransformer; |
||
42 | |||
43 | return [ |
||
44 | 'facetsAsn' => $twigConfigTransformer->transform( |
||
45 | $webComponentsConfig->getAsnSliderComponentConfig() |
||
46 | ), |
||
47 | 'breadcrumb' => $twigConfigTransformer->transform( |
||
48 | $webComponentsConfig->getBreadcrumbComponentConfig() |
||
49 | ), |
||
50 | 'campaign' => $twigConfigTransformer->transform( |
||
51 | $webComponentsConfig->getCampaignWidgetComponentConfig() |
||
52 | ), |
||
53 | 'communication' => $twigConfigTransformer->transform( |
||
54 | $webComponentsConfig->getCommunicationComponentConfig() |
||
55 | ), |
||
56 | 'headerNavigation' => $twigConfigTransformer->transform( |
||
57 | $webComponentsConfig->getHeaderNavigationWidgetComponentConfig() |
||
58 | ), |
||
59 | 'paging' => $twigConfigTransformer->transform( |
||
60 | $webComponentsConfig->getPagingWidgetComponentConfig() |
||
61 | ), |
||
62 | 'productsPerPage' => $twigConfigTransformer->transform( |
||
63 | $webComponentsConfig->getProductsPerPageWidgetComponentConfig() |
||
64 | ), |
||
65 | 'pushedProducts' => $twigConfigTransformer->transform( |
||
66 | $webComponentsConfig->getPushedProductsWidgetComponentConfig() |
||
67 | ), |
||
68 | 'recommendation' => $twigConfigTransformer->transform( |
||
69 | $webComponentsConfig->getRecommendationComponentConfig() |
||
70 | ), |
||
71 | 'recordList' => $twigConfigTransformer->transform( |
||
72 | $webComponentsConfig->getRecordListComponentConfig() |
||
73 | ), |
||
74 | 'suggest' => $twigConfigTransformer->transform( |
||
75 | $webComponentsConfig->getSuggestComponentConfig() |
||
76 | ), |
||
77 | 'checkoutTracking' => $twigConfigTransformer->transform( |
||
78 | $webComponentsConfig->getCheckoutTrackingComponentConfig() |
||
79 | ), |
||
80 | 'searchbox' => $twigConfigTransformer->transform( |
||
81 | $webComponentsConfig->getSearchBoxComponentConfig() |
||
82 | ), |
||
83 | 'similarProducts' => $twigConfigTransformer->transform( |
||
84 | $webComponentsConfig->getSimilarProductsComponentConfig() |
||
85 | ), |
||
86 | 'sortBox' => $twigConfigTransformer->transform( |
||
87 | $webComponentsConfig->getSortBoxWidgetComponentConfig() |
||
88 | ), |
||
89 | 'tagCloud' => $twigConfigTransformer->transform( |
||
90 | $webComponentsConfig->getTagCloudWidgetComponentConfig() |
||
91 | ), |
||
95 |