ProductModelImportMap::getMap()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 30
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 1
eloc 20
c 2
b 0
f 1
nc 1
nop 0
dl 0
loc 30
rs 9.6
1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\AkeneoPimMiddlewareConnector\Business\Mapper\Map;
9
10
use SprykerEco\Zed\AkeneoPimMiddlewareConnector\AkeneoPimMiddlewareConnectorConfig;
11
use SprykerMiddleware\Zed\Process\Business\Mapper\Map\AbstractMap;
0 ignored issues
show
Bug introduced by
The type SprykerMiddleware\Zed\Pr...\Mapper\Map\AbstractMap was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use SprykerMiddleware\Zed\Process\Business\Mapper\Map\MapInterface;
0 ignored issues
show
Bug introduced by
The type SprykerMiddleware\Zed\Pr...Mapper\Map\MapInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
14
class ProductModelImportMap extends AbstractMap
15
{
16
    /**
17
     * @var \SprykerEco\Zed\AkeneoPimMiddlewareConnector\AkeneoPimMiddlewareConnectorConfig
18
     */
19
    private $config;
20
21
    /**
22
     * @param \SprykerEco\Zed\AkeneoPimMiddlewareConnector\AkeneoPimMiddlewareConnectorConfig $config
23
     */
24
    public function __construct(AkeneoPimMiddlewareConnectorConfig $config)
25
    {
26
        $this->config = $config;
27
    }
28
29
    /**
30
     * @return array
31
     */
32
    public function getMap(): array
33
    {
34
        return [
35
            'taxSetName' => function ($item) {
0 ignored issues
show
Unused Code introduced by
The parameter $item is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

35
            'taxSetName' => function (/** @scrutinizer ignore-unused */ $item) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
36
                return $this->config->getTaxSet();
37
            },
38
            'new_from' => function ($item) {
0 ignored issues
show
Unused Code introduced by
The parameter $item is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

38
            'new_from' => function (/** @scrutinizer ignore-unused */ $item) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
39
                return null;
40
            },
41
            'new_to' => function ($item) {
0 ignored issues
show
Unused Code introduced by
The parameter $item is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

41
            'new_to' => function (/** @scrutinizer ignore-unused */ $item) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
42
                return null;
43
            },
44
            'category_product_order' => function ($item) {
0 ignored issues
show
Unused Code introduced by
The parameter $item is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

44
            'category_product_order' => function (/** @scrutinizer ignore-unused */ $item) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
45
                return 0;
46
            },
47
            'abstract_sku' => 'code',
48
            'category_key' => 'categories',
49
            'is_active' => 'enabled',
50
51
            'attributes' => [
52
                'values.attributes',
53
            ],
54
            'localizedAttributes' => [
55
                'values.localizedAttributes',
56
            ],
57
            'color_code' => function ($item) {
0 ignored issues
show
Unused Code introduced by
The parameter $item is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

57
            'color_code' => function (/** @scrutinizer ignore-unused */ $item) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
58
                return '';
59
            },
60
            'stores' => function ($item) {
0 ignored issues
show
Unused Code introduced by
The parameter $item is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

60
            'stores' => function (/** @scrutinizer ignore-unused */ $item) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
61
                return $this->config->getActiveStoresForProducts();
62
            },
63
        ];
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getStrategy(): string
70
    {
71
        return MapInterface::MAPPER_STRATEGY_SKIP_UNKNOWN;
72
    }
73
}
74