ImagineCacheManagerResolver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getUrl() 0 4 1
1
<?php
2
3
/**
4
 * Copyright 2014 Jonathan Bouzekri. All rights reserved.
5
 *
6
 * @copyright Copyright 2014 Jonathan Bouzekri <[email protected]>
7
 * @license https://github.com/jbouzekri/FileUploaderBundle/blob/master/LICENSE
8
 * @link https://github.com/jbouzekri/FileUploaderBundle
9
 */
10
11
namespace Jb\Bundle\FileUploaderBundle\Service\Resolver;
12
13
use Liip\ImagineBundle\Imagine\Cache\CacheManager;
14
15
/**
16
 * ImagineCacheManagerResolver
17
 *
18
 * @author jobou
19
 */
20
class ImagineCacheManagerResolver implements ResolverInterface
21
{
22
    /**
23
     * @var \Liip\ImagineBundle\Imagine\Cache\CacheManager
24
     */
25
    protected $imagine;
26
27
    /**
28
     * Constructor
29
     *
30
     * @param \Liip\ImagineBundle\Imagine\Cache\CacheManager $imagine
31
     */
32
    public function __construct(CacheManager $imagine)
33
    {
34
        $this->imagine = $imagine;
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function getUrl($key)
41
    {
42
        return $this->imagine->getBrowserPath($key, 'original');
43
    }
44
}
45