Passed
Push — master ( afdc6b...e39cc4 )
by Adrien
03:24
created

HeadLink::__call()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 7
ccs 0
cts 6
cp 0
rs 10
cc 2
nc 2
nop 2
crap 6
1
<?php
2
3
namespace mQueue\View\Helper;
4
5
use Zend_View_Helper_HeadLink;
6
7
class HeadLink extends Zend_View_Helper_HeadLink
8
{
9
    /**
10
     * Override parent to inject the last modified time of file.
11
     * This avoid browser cache and force reloading when the file changed.
12
     *
13
     * @param string $method
14
     * @param array $args
15
     *
16
     * @return mixed
17
     */
18
    public function __call($method, $args)
19
    {
20
        if (mb_strpos($method, 'Stylesheet')) {
21
            $args[0] = $this->view->cacheStamp($args[0]);
22
        }
23
24
        return parent::__call($method, $args);
0 ignored issues
show
Bug introduced by
Are you sure the usage of parent::__call($method, $args) targeting Zend_View_Helper_HeadLink::__call() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
25
    }
26
}
27