CategoryImportMap   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 13
c 1
b 0
f 1
dl 0
loc 30
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getMap() 0 15 1
A getStrategy() 0 3 1
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 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...
11
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...
12
13
class CategoryImportMap extends AbstractMap
14
{
15
    /**
16
     * @return array
17
     */
18
    public function getMap(): array
19
    {
20
        return [
21
            'category_key' => 'code',
22
            'parent_category_key' => 'parent',
23
            'localizedAttributes' => 'labels',
24
            'locales' => 'labels',
25
            'is_root' => function (array $item) {
26
                return empty($item['parent']);
27
            },
28
            'is_main' => function (array $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

28
            'is_main' => function (/** @scrutinizer ignore-unused */ array $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...
29
                return true;
30
            },
31
            'fk_category_template' => function (array $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

31
            'fk_category_template' => function (/** @scrutinizer ignore-unused */ array $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...
32
                return null;
33
            },
34
        ];
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getStrategy(): string
41
    {
42
        return MapInterface::MAPPER_STRATEGY_SKIP_UNKNOWN;
43
    }
44
}
45