HeadLink::__call()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 7
rs 10
ccs 4
cts 4
cp 1
cc 2
nc 2
nop 2
crap 2
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 12
    public function __call($method, $args)
19
    {
20 12
        if (mb_strpos($method, 'Stylesheet')) {
21 12
            $args[0] = $this->view->cacheStamp($args[0]);
22
        }
23
24 12
        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