GlobalVariables   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 25
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getPixlr() 0 4 2
A getPool() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\MediaBundle\Twig;
15
16
use Sonata\MediaBundle\Extra\Pixlr;
17
use Sonata\MediaBundle\Provider\Pool;
18
use Symfony\Component\DependencyInjection\ContainerInterface;
19
20
/**
21
 * GlobalVariables.
22
 *
23
 * @final since sonata-project/media-bundle 3.21.0
24
 *
25
 * @author Thomas Rabaix <[email protected]>
26
 */
27
class GlobalVariables
28
{
29
    protected $container;
30
31
    public function __construct(ContainerInterface $container)
32
    {
33
        $this->container = $container;
34
    }
35
36
    /**
37
     * @return Pixlr|bool
38
     */
39
    public function getPixlr()
40
    {
41
        return $this->container->has('sonata.media.extra.pixlr') ? $this->container->get('sonata.media.extra.pixlr') : false;
42
    }
43
44
    /**
45
     * @return Pool
46
     */
47
    public function getPool()
48
    {
49
        return $this->container->get('sonata.media.pool');
50
    }
51
}
52