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