GlobalVariables::getPixlr()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
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