Completed
Push — master ( 0a7932...aee286 )
by Maksim
13s
created

ImagineHelper::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Liip\ImagineBundle\Templating\Helper;
4
5
use Liip\ImagineBundle\Imagine\Cache\CacheManager;
6
use Symfony\Component\Templating\Helper\Helper;
7
8
class ImagineHelper extends Helper
9
{
10
    /**
11
     * @var CacheManager
12
     */
13
    protected $cacheManager;
14
15
    /**
16
     * @param CacheManager $cacheManager
17
     */
18
    public function __construct(CacheManager $cacheManager)
19
    {
20
        $this->cacheManager = $cacheManager;
21
    }
22
23
    /**
24
     * Gets the browser path for the image and filter to apply.
25
     *
26
     * @param string $path
27
     * @param string $filter
28
     * @param array  $runtimeConfig
29
     *
30
     * @return string
31
     */
32
    public function filter($path, $filter, array $runtimeConfig = array())
33
    {
34
        return $this->cacheManager->getBrowserPath($path, $filter, $runtimeConfig);
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function getName()
41
    {
42
        return 'liip_imagine';
43
    }
44
}
45