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

LocalAdapterUrlEncoder::getUrl()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 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
}