Completed
Push — 2.0 ( 6cd6ae...d9081a )
by Rob
11s
created

FilterTrait::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the `liip/LiipImagineBundle` project.
5
 *
6
 * (c) https://github.com/liip/LiipImagineBundle/graphs/contributors
7
 *
8
 * For the full copyright and license information, please view the LICENSE.md
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Liip\ImagineBundle\Templating;
13
14
use Liip\ImagineBundle\Imagine\Cache\CacheManager;
15
16
trait FilterTrait
17
{
18
    /**
19
     * @var CacheManager
20
     */
21
    private $cache;
22
23
    /**
24
     * @param CacheManager $cache
25
     */
26
    public function __construct(CacheManager $cache)
27
    {
28
        $this->cache = $cache;
29
    }
30
31
    /**
32
     * Gets the browser path for the image and filter to apply.
33
     *
34
     * @param string $path
35
     * @param string $filter
36
     * @param array  $config
37
     *
38
     * @return string
39
     */
40
    public function filter($path, $filter, array $config = [], $resolver = null)
41
    {
42
        return $this->cache->getBrowserPath($path, $filter, $config, $resolver);
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function getName()
49
    {
50
        return 'liip_imagine';
51
    }
52
}
53