Completed
Push — master ( 70d1cb...b61b4a )
by André
83:39 queued 66:02
created

RelativeResolver::remove()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
namespace eZ\Bundle\EzPublishCoreBundle\Imagine\Cache\Resolver;
8
9
use Liip\ImagineBundle\Imagine\Cache\Resolver\ResolverInterface;
10
use Liip\ImagineBundle\Imagine\Cache\Resolver\ProxyResolver as ImagineProxyResolver;
11
12
/**
13
 * Relative resolver, omits host info.
14
 */
15
class RelativeResolver extends ImagineProxyResolver
16
{
17
    /**
18
     * @param \Liip\ImagineBundle\Imagine\Cache\Resolver\ResolverInterface $resolver
19
     */
20
    public function __construct(ResolverInterface $resolver)
21
    {
22
        parent::__construct($resolver, []);
23
    }
24
25
    /**
26
     * Returns relative image path.
27
     *
28
     * @param $url string
29
     * @return string
30
     */
31
    protected function rewriteUrl($url)
32
    {
33
        return parse_url($url, PHP_URL_PATH);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The expression parse_url($url, PHP_URL_PATH); of type string|false adds false to the return on line 33 which is incompatible with the return type of the parent method Liip\ImagineBundle\Imagi...oxyResolver::rewriteUrl of type string. It seems like you forgot to handle an error condition.
Loading history...
34
    }
35
}
36