Passed
Push — bugfix/supesc-277-extend-the-c... ( 81fc44 )
by Oleh
06:05
created

CrefoPayDependencyProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addUtilTextService() 0 7 1
A provideServiceDependencies() 0 5 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\Service\CrefoPay;
9
10
use Spryker\Service\Kernel\AbstractBundleDependencyProvider;
11
use Spryker\Service\Kernel\Container;
12
use SprykerEco\Service\CrefoPay\Dependency\Service\CrefoPayToUtilTextServiceBridge;
13
14
class CrefoPayDependencyProvider extends AbstractBundleDependencyProvider
15
{
16
    public const SERVICE_UTIL_TEXT = 'SERVICE.SERVICE_UTIL_TEXT';
17
18
    /**
19
     * @param Container $container
20
     *
21
     * @return Container
22
     */
23
    public function provideServiceDependencies(Container $container)
24
    {
25
        $container = parent::provideServiceDependencies($container);
26
27
        return $this->addUtilTextService($container);
28
    }
29
30
    /**
31
     * @param \Spryker\Zed\Kernel\Container $container
32
     *
33
     * @return \Spryker\Zed\Kernel\Container
34
     */
35
    protected function addUtilTextService(Container $container): Container
36
    {
37
        $container->set(static::SERVICE_UTIL_TEXT, function (Container $container) {
38
            return new CrefoPayToUtilTextServiceBridge($container->getLocator()->utilText()->service());
39
        });
40
41
        return $container;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $container returns the type Spryker\Service\Kernel\Container which is incompatible with the documented return type Spryker\Zed\Kernel\Container.
Loading history...
42
    }
43
}
44