Passed
Push — karoly/akeneo-skeleton ( dfb631 )
by Karoly
05:38
created

ProductConcreteSyncer   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 77
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A validate() 0 3 1
A map() 0 3 1
A write() 0 3 1
A translate() 0 3 1
A read() 0 3 1
1
<?php
2
3
4
namespace Spryker\Zed\AkeneoPim\Business\Syncer;
5
6
use Generated\Shared\Transfer\AkeneoProductConcreteSyncConfigTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...creteSyncConfigTransfer 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...
7
use Generated\Shared\Transfer\AkeneoSyncValidateResultTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...cValidateResultTransfer 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...
8
use Generated\Shared\Transfer\AkeneoSyncWriteResultTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...SyncWriteResultTransfer 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...
9
10
class ProductConcreteSyncer extends AbstractSyncer
11
{
12
    /** @var ProductConcreteAkeneoReader */
0 ignored issues
show
Bug introduced by
The type Spryker\Zed\AkeneoPim\Bu...uctConcreteAkeneoReader 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
    protected $reader;
14
15
    /** @var ProductConcreteAkeneoValidator */
0 ignored issues
show
Bug introduced by
The type Spryker\Zed\AkeneoPim\Bu...ConcreteAkeneoValidator 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...
16
    protected $validator;
17
18
    /** @var ProductConcreteAkeneoTranslator */
0 ignored issues
show
Bug introduced by
The type Spryker\Zed\AkeneoPim\Bu...oncreteAkeneoTranslator 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...
19
    protected $translator;
20
21
    /** @var ProductConcreteAkeneMapper */
0 ignored issues
show
Bug introduced by
The type Spryker\Zed\AkeneoPim\Bu...ductConcreteAkeneMapper 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...
22
    protected $mapper;
23
24
    /** @var ProductConcreteWriter */
0 ignored issues
show
Bug introduced by
The type Spryker\Zed\AkeneoPim\Bu...r\ProductConcreteWriter 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...
25
    protected $writer;
26
27
    /**
28
     * @param AkeneoProductConcreteSyncConfigTransfer $productConcreteSyncConfig
29
     *
30
     * @return array
31
     */
32
    protected function read($productConcreteSyncConfig): array
33
    {
34
        return $this->reader->read($productConcreteSyncConfig->getReadConfig());
35
36
        // return [[],[],[]];
37
    }
38
39
    /**
40
     * @param array $akeneoEntity
41
     * @param AkeneoProductConcreteSyncConfigTransfer $productConcreteSyncConfig
42
     *
43
     * @return AkeneoSyncValidateResultTransfer
44
     */
45
    protected function validate(array $akeneoEntity, $productConcreteSyncConfig): AkeneoSyncValidateResultTransfer
46
    {
47
        return $this->validator->validate($akeneoEntity, $productConcreteSyncConfig->getValidateConfig());
48
49
        //return (new AkeneoSyncValidateResultTransfer())->setIsSuccess(true);
50
    }
51
52
    /**
53
     * @param array $akeneoEntity
54
     * @param AkeneoProductConcreteSyncConfigTransfer $productConcreteSyncConfig
55
     *
56
     * @return array
57
     */
58
    protected function translate(array $akeneoEntity, $productConcreteSyncConfig): array
59
    {
60
        return $this->translator->translate($akeneoEntity, $productConcreteSyncConfig->getTranslateConfig());
61
62
        // return $akeneoEntity;
63
    }
64
65
    /**
66
     * @param array $akeneoEntity
67
     * @param AkeneoProductConcreteSyncConfigTransfer $productConcreteSyncConfig
68
     *
69
     * @return array
70
     */
71
    protected function map(array $akeneoEntity, $productConcreteSyncConfig): array
72
    {
73
        return $this->mapper->map($akeneoEntity, $productConcreteSyncConfig->getMapConfig());
74
75
     //   return $akeneoEntity;
76
    }
77
78
    /**
79
     * @param array $sprykerEntity
80
     * @param AkeneoProductConcreteSyncConfigTransfer $productConcreteSyncConfig
81
     *
82
     * @return AkeneoSyncWriteResultTransfer
83
     */
84
    protected function write(array $sprykerEntity, $productConcreteSyncConfig): AkeneoSyncWriteResultTransfer
85
    {
86
        return $this->writer->write($sprykerEntity, $productConcreteSyncConfig->getWriteConfig());
87
88
        //return (new AkeneoSyncWriteResultTransfer())->setIsSuccess(true);
89
    }
90
}
91