| Conditions | 1 |
| Paths | 1 |
| Total Lines | 68 |
| Code Lines | 49 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | 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 |
||
| 60 | public function usedServicesDataProvider(): array { |
||
| 61 | return [ |
||
| 62 | // Used in both places |
||
| 63 | 'Attribute Repository' => [ |
||
| 64 | 'pim_catalog.repository.attribute', |
||
| 65 | AttributeRepositoryInterface::class |
||
| 66 | ], |
||
| 67 | 'External API Serializer' => [ |
||
| 68 | 'pim_external_api_serializer', |
||
| 69 | NormalizerInterface::class |
||
| 70 | ], |
||
| 71 | 'Product Validator' => [ |
||
| 72 | 'pim_catalog.validator.product', |
||
| 73 | ValidatorInterface::class |
||
| 74 | ], |
||
| 75 | 'Normalizer Violation' => [ |
||
| 76 | 'pim_enrich.normalizer.violation', |
||
| 77 | NormalizerInterface::class |
||
| 78 | ], |
||
| 79 | 'Product Builder' => [ |
||
| 80 | 'pim_catalog.builder.product', |
||
| 81 | ProductBuilderInterface::class |
||
| 82 | ], |
||
| 83 | // Only used for product models |
||
| 84 | 'Product Model Repository' => [ |
||
| 85 | 'pim_catalog.repository.product_model', |
||
| 86 | ProductModelRepositoryInterface::class |
||
| 87 | ], |
||
| 88 | 'Product Model Factory' => [ |
||
| 89 | 'pim_catalog.factory.product_model', |
||
| 90 | SimpleFactoryInterface::class |
||
| 91 | ], |
||
| 92 | 'Product Model Updater' => [ |
||
| 93 | 'pim_catalog.updater.product_model', |
||
| 94 | ObjectUpdaterInterface::class |
||
| 95 | ], |
||
| 96 | 'Product Model Saver' => [ |
||
| 97 | 'pim_catalog.saver.product_model', |
||
| 98 | SaverInterface::class |
||
| 99 | ], |
||
| 100 | // Only used for products |
||
| 101 | 'Product Repository' => [ |
||
| 102 | 'pim_catalog.repository.product', |
||
| 103 | ProductRepositoryInterface::class |
||
| 104 | ], |
||
| 105 | 'Product Updater' => [ |
||
| 106 | 'pim_catalog.updater.product', |
||
| 107 | ObjectUpdaterInterface::class |
||
| 108 | ], |
||
| 109 | 'Product Saver' => [ |
||
| 110 | 'pim_catalog.saver.product', |
||
| 111 | SaverInterface::class |
||
| 112 | ], |
||
| 113 | 'User Context' => [ |
||
| 114 | 'pim_user.context.user', |
||
| 115 | UserContext::class |
||
| 116 | ], |
||
| 117 | 'Localizer Converter' => [ |
||
| 118 | 'pim_catalog.localization.localizer.converter', |
||
| 119 | AttributeConverterInterface::class |
||
| 120 | ], |
||
| 121 | 'Comparator Product Filter ' => [ |
||
| 122 | 'pim_catalog.comparator.filter.product', |
||
| 123 | FilterInterface::class |
||
| 124 | ], |
||
| 125 | 'Enrich to Standard product Value Converter' => [ |
||
| 126 | 'pim_enrich.converter.enrich_to_standard.product_value', |
||
| 127 | ConverterInterface::class |
||
| 128 | ], |
||
| 133 |