Passed
Branch development (0519a2)
by Theodoros
02:02
created

provideBusinessLayerDependencies()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 30
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 15
nc 1
nop 1
dl 0
loc 30
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Econda;
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\Econda\Communication\Plugin\CategoryPlugin;
13
use SprykerEco\Zed\Econda\Communication\Plugin\ProductsPlugin;
14
use SprykerEco\Zed\Econda\Dependency\Facade\EcondaToLocaleBridge;
15
use SprykerEco\Zed\Econda\Dependency\Facade\EcondaToPriceBridge;
16
use SprykerEco\Zed\Econda\Dependency\Facade\EcondaToPropelBridge;
17
18
class EcondaDependencyProvider extends AbstractBundleDependencyProvider
19
{
20
21
    const FACADE_LOCALE = 'facade_locale';
22
    const FACADE_PROPEL = 'facade_propel';
23
    const FACADE_PRICE = 'facade_price';
24
    const QUERY_CONTAINER_PRODUCT_IMAGE = 'query_container_product_image';
25
    const QUERY_CONTAINER_PRODUCT_CATEGORY = 'QUERY_CONTAINER_PRODUCT_CATEGORY';
26
    const FILE_PLUGINS = 'file plugins';
27
28
    /**
29
     * @param \Spryker\Zed\Kernel\Container $container
30
     *
31
     * @return \Spryker\Zed\Kernel\Container
32
     */
33
    public function provideBusinessLayerDependencies(Container $container)
34
    {
35
        $container[static::FACADE_LOCALE] = function (Container $container) {
36
            return new EcondaToLocaleBridge($container->getLocator()->locale()->facade());
37
        };
38
39
        $container[self::FACADE_PROPEL] = function (Container $container) {
40
            return new EcondaToPropelBridge($container->getLocator()->propel()->facade());
41
        };
42
43
        $container[self::FACADE_PRICE] = function (Container $container) {
44
            return new EcondaToPriceBridge($container->getLocator()->price()->facade());
45
        };
46
47
        $container[self::QUERY_CONTAINER_PRODUCT_IMAGE] = function (Container $container) {
48
            return $container->getLocator()->productImage()->queryContainer();
49
        };
50
51
        $container[self::QUERY_CONTAINER_PRODUCT_CATEGORY] = function (Container $container) {
52
            return $container->getLocator()->productCategory()->queryContainer();
53
        };
54
55
        $container[self::FILE_PLUGINS] = 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

55
        $container[self::FILE_PLUGINS] = 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...
56
            return [
57
                'products' => new ProductsPlugin(),
58
                'categories' => new CategoryPlugin(),
59
            ];
60
        };
61
62
        return $container;
63
    }
64
65
}
66