ValidatorFactory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A createProductAbstractExistValidator() 0 3 1
A __construct() 0 3 1
A createValidator() 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\Validator\Validators\Factory;
9
10
use SprykerEco\Zed\AkeneoPimMiddlewareConnector\Business\Validator\Validators\ProductAbstractExistValidator;
11
use SprykerEco\Zed\AkeneoPimMiddlewareConnector\Dependency\Facade\AkeneoPimMiddlewareConnectorToProductFacadeBridgeInterface;
12
use SprykerMiddleware\Zed\Process\Business\Validator\Validators\ValidatorInterface;
0 ignored issues
show
Bug introduced by
The type SprykerMiddleware\Zed\Pr...tors\ValidatorInterface 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 ValidatorFactory implements ValidatorFactoryInterface
15
{
16
    /**
17
     * @var \SprykerEco\Zed\AkeneoPimMiddlewareConnector\Dependency\Facade\AkeneoPimMiddlewareConnectorToProductFacadeBridgeInterface
18
     */
19
    protected $productFacade;
20
21
    /**
22
     * @param \SprykerEco\Zed\AkeneoPimMiddlewareConnector\Dependency\Facade\AkeneoPimMiddlewareConnectorToProductFacadeBridgeInterface $productFacade
23
     */
24
    public function __construct(AkeneoPimMiddlewareConnectorToProductFacadeBridgeInterface $productFacade)
25
    {
26
        $this->productFacade = $productFacade;
27
    }
28
29
    /**
30
     * @param string $validatorClassName
31
     *
32
     * @return \SprykerMiddleware\Zed\Process\Business\Validator\Validators\ValidatorInterface
33
     */
34
    public function createValidator(string $validatorClassName): ValidatorInterface
35
    {
36
        return new $validatorClassName();
37
    }
38
39
    /**
40
     * @return \SprykerMiddleware\Zed\Process\Business\Validator\Validators\ValidatorInterface
41
     */
42
    public function createProductAbstractExistValidator(): ValidatorInterface
43
    {
44
        return new ProductAbstractExistValidator($this->productFacade);
45
    }
46
}
47