Conditions | 3 |
Paths | 2 |
Total Lines | 51 |
Code Lines | 13 |
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 |
||
45 | public function __construct( \Aimeos\MShop\ContextIface $context, array $mapping, |
||
46 | ?\Aimeos\Controller\Jobs\Common\Product\Import\Csv\Processor\Iface $object = null ) |
||
47 | { |
||
48 | parent::__construct( $context, $mapping, $object ); |
||
49 | |||
50 | $config = $context->config(); |
||
51 | |||
52 | /** controller/jobs/product/import/csv/product/listtypes |
||
53 | * Names of the product list types that are updated or removed |
||
54 | * |
||
55 | * Aimeos offers associated items like "bought together" products that |
||
56 | * are automatically generated by other job controllers. These relations |
||
57 | * shouldn't normally be overwritten or deleted by default during the |
||
58 | * import and this confiuration option enables you to specify the list |
||
59 | * types that should be updated or removed if not available in the import |
||
60 | * file. |
||
61 | * |
||
62 | * Contrary, if you don't generate any relations automatically in the |
||
63 | * shop and want to import those relations too, you can set the option |
||
64 | * to null to update all associated items. |
||
65 | * |
||
66 | * @param array|null List of product list type names or null for all |
||
67 | * @since 2015.05 |
||
68 | * @see controller/jobs/product/import/csv/domains |
||
69 | * @see controller/jobs/product/import/csv/separator |
||
70 | * @see controller/jobs/product/import/csv/attribute/listtypes |
||
71 | * @see controller/jobs/product/import/csv/catalog/listtypes |
||
72 | * @see controller/jobs/product/import/csv/media/listtypes |
||
73 | * @see controller/jobs/product/import/csv/price/listtypes |
||
74 | * @see controller/jobs/product/import/csv/supplier/listtypes |
||
75 | * @see controller/jobs/product/import/csv/text/listtypes |
||
76 | */ |
||
77 | $default = $config->get( 'controller/jobs/product/import/csv/processor/product/listtypes', ['default', 'suggestion'] ); |
||
78 | $this->listTypes = $config->get( 'controller/jobs/product/import/csv/product/listtypes', $default ); |
||
79 | |||
80 | if( $this->listTypes === null ) |
||
81 | { |
||
82 | $this->listTypes = []; |
||
83 | $manager = \Aimeos\MShop::create( $context, 'product/lists/type' ); |
||
84 | $search = $manager->filter()->slice( 0, 0x7fffffff ); |
||
85 | |||
86 | foreach( $manager->search( $search ) as $item ) { |
||
87 | $this->listTypes[$item->getCode()] = $item->getCode(); |
||
88 | } |
||
89 | } |
||
90 | else |
||
91 | { |
||
92 | $this->listTypes = array_combine( $this->listTypes, $this->listTypes ); |
||
93 | } |
||
94 | |||
95 | $this->cache = $this->getCache( 'product' ); |
||
96 | } |
||
176 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.