Passed
Push — feature/paypal-express ( be9f92...d19b14 )
by Volodymyr
05:26
created

BraintreeDependencyProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 43
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A provideDependencies() 0 5 1
A addCurrencyPlugin() 0 7 1
A addQuoteClinet() 0 7 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\Yves\Braintree;
9
10
use Spryker\Yves\Currency\Plugin\CurrencyPlugin;
11
use Spryker\Yves\Kernel\AbstractBundleDependencyProvider;
12
use Spryker\Yves\Kernel\Container;
13
14
class BraintreeDependencyProvider extends AbstractBundleDependencyProvider
15
{
16
    public const PLUGIN_CURRENCY = 'PLUGIN_CURRENCY';
17
    public const CLIENT_QUOTE = 'QUOTE_CLIENT';
18
19
    /**
20
     * @param \Spryker\Yves\Kernel\Container $container
21
     *
22
     * @return \Spryker\Yves\Kernel\Container|\Spryker\Zed\Kernel\Container
23
     */
24
    public function provideDependencies(Container $container)
25
    {
26
        $container = $this->addCurrencyPlugin($container);
27
28
        return $container;
29
    }
30
31
    /**
32
     * @param \Spryker\Yves\Kernel\Container $container
33
     *
34
     * @return \Spryker\Yves\Kernel\Container
35
     */
36
    protected function addCurrencyPlugin(Container $container)
37
    {
38
        $container[static::PLUGIN_CURRENCY] = function (Container $container) {
0 ignored issues
show
Unused Code introduced by
The parameter $container 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

38
        $container[static::PLUGIN_CURRENCY] = function (/** @scrutinizer ignore-unused */ Container $container) {

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...
39
            return new CurrencyPlugin();
40
        };
41
42
        return $container;
43
    }
44
45
    /**
46
     * @param \Spryker\Yves\Kernel\Container $container
47
     *
48
     * @return \Spryker\Yves\Kernel\Container
49
     */
50
    protected function addQuoteClinet(Container $container): Container
51
    {
52
        $container[static::CLIENT_QUOTE] = function (Container $container) {
53
            return $container->getLocator()->quote()->client();
54
        };
55
56
        return $container;
57
    }
58
}
59