Completed
Push — master ( a06a95...a1d542 )
by dan
15s
created

LocalAdapterUrlEncoder   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUrl() 0 6 2
A getData() 0 6 2
1
<?php
2
/**
3
 * This file is part of the IrishDan\ResponsiveImageBundle package.
4
 *
5
 * (c) Daniel Byrne <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE file that was distributed with this source
8
 * code.
9
 */
10
11
namespace IrishDan\ResponsiveImageBundle\Url;
12
13
14
/**
15
 * Class LocalAdapterUrlEncoder
16
 *
17
 * @package IrishDan\ResponsiveImageBundle\Url
18
 */
19
class LocalAdapterUrlEncoder implements UrlEncoderInterface
20
{
21
    /**
22
     * @param            $adapter
23
     * @param array|null $config
24
     *
25
     * @return mixed|string
26
     */
27
    public function getUrl($adapter, array $config = null)
28
    {
29
        $path = empty($config['image_directory']) ? 'image' : $config['image_directory'];
30
31
        return $path;
32
    }
33
34
    public function getData($adapter, array $config = null)
35
    {
36
        return [
37
            empty($config['image_directory']) ? 'image' : $config['image_directory'],
38
        ];
39
    }
40
}