ShopUiCompatibilityTwigServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 9 1
A boot() 0 2 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\Yves\ShopUiCompatibility\Plugin\Provider;
9
10
use Silex\Application;
11
use Silex\ServiceProviderInterface;
12
use Spryker\Yves\Kernel\AbstractPlugin;
13
use Twig_Environment;
0 ignored issues
show
Bug introduced by
The type Twig_Environment 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...
14
15
/**
16
 * @method \SprykerEco\Yves\ShopUiCompatibility\ShopUiCompatibilityFactory getFactory()
17
 */
18
class ShopUiCompatibilityTwigServiceProvider extends AbstractPlugin implements ServiceProviderInterface
19
{
20
    /**
21
     * @param \Silex\Application $app
22
     *
23
     * @return void
24
     */
25
    public function register(Application $app)
26
    {
27
        $twigExtension = $this->getFactory()->createShopUiCompatibilityTwigExtension();
28
29
        $app['twig'] = $app->share(
0 ignored issues
show
Deprecated Code introduced by
The function Spryker\Service\Container\Container::share() has been deprecated: Do not use this method anymore. All services are shared by default now. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

29
        $app['twig'] = /** @scrutinizer ignore-deprecated */ $app->share(

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
30
            $app->extend('twig', function (Twig_Environment $twig) use ($twigExtension) {
31
                $twig->addExtension($twigExtension);
32
33
                return $twig;
34
            })
35
        );
36
    }
37
38
    /**
39
     * @param \Silex\Application $app
40
     *
41
     * @return void
42
     */
43
    public function boot(Application $app)
44
    {
45
    }
46
}
47