Passed
Push — feature/eco-2295/eco-2344-crea... ( cd4fd8...13938b )
by Aleksey
01:14
created

addCrefoPayApiService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Zed\CrefoPayApi;
9
10
use Spryker\Zed\Kernel\AbstractBundleDependencyProvider;
0 ignored issues
show
Bug introduced by
The type Spryker\Zed\Kernel\Abstr...undleDependencyProvider 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 Spryker\Zed\Kernel\Container;
0 ignored issues
show
Bug introduced by
The type Spryker\Zed\Kernel\Container 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 SprykerEco\Zed\CrefoPayApi\Dependency\Service\CrefoPayApiToUtilEncodingServiceBridge;
13
14
class CrefoPayApiDependencyProvider extends AbstractBundleDependencyProvider
15
{
16
    public const SERVICE_UTIL_ENCODING = 'SERVICE_UTIL_ENCODING';
17
    public const SERVICE_CREFO_PAY_API = 'SERVICE_CREFO_PAY_API';
18
19
    /**
20
     * @param \Spryker\Zed\Kernel\Container $container
21
     *
22
     * @return \Spryker\Zed\Kernel\Container
23
     */
24
    public function provideBusinessLayerDependencies(Container $container): Container
25
    {
26
        $container = parent::provideBusinessLayerDependencies($container);
27
        $container = $this->addUtilEncodingService($container);
28
        $container = $this->addCrefoPayApiService($container);
29
30
        return $container;
31
    }
32
33
    /**
34
     * @param \Spryker\Zed\Kernel\Container $container
35
     *
36
     * @return \Spryker\Zed\Kernel\Container
37
     */
38
    protected function addUtilEncodingService(Container $container): Container
39
    {
40
        $container[static::SERVICE_UTIL_ENCODING] = function (Container $container) {
41
            return new CrefoPayApiToUtilEncodingServiceBridge($container->getLocator()->utilEncoding()->service());
42
        };
43
44
        return $container;
45
    }
46
47
    /**
48
     * @param \Spryker\Zed\Kernel\Container $container
49
     *
50
     * @return \Spryker\Zed\Kernel\Container
51
     */
52
    protected function addCrefoPayApiService(Container $container): Container
53
    {
54
        $container[static::SERVICE_CREFO_PAY_API] = function (Container $container) {
55
            return $container->getLocator()->crefoPayApi()->service();
56
        };
57
58
        return $container;
59
    }
60
}
61