Volt   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A initCompiler() 0 23 1
1
<?php
2
3
/**
4
 * Volt
5
 * @copyright Copyright (c) 2011 - 2014 Aleksandr Torosh (http://wezoom.com.ua)
6
 * @author Aleksandr Torosh <[email protected]>
7
 */
8
9
namespace Application\Mvc\View\Engine;
10
11
class Volt extends \Phalcon\Mvc\View\Engine\Volt
12
{
13
14
    public function initCompiler()
15
    {
16
        $compiler = $this->getCompiler();
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $compiler is correct as $this->getCompiler() (which targets Phalcon\Mvc\View\Engine\Volt::getCompiler()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

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

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

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

Loading history...
17
18
        $compiler->addFunction('helper', function () {
0 ignored issues
show
Bug introduced by
The method addFunction cannot be called on $compiler (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
19
            return '$this->helper';
20
        });
21
        $compiler->addFunction('translate', function ($resolvedArgs) {
0 ignored issues
show
Bug introduced by
The method addFunction cannot be called on $compiler (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
22
            return '$this->helper->translate(\'.$resolvedArgs.\')';
23
        });
24
        $compiler->addFunction('langUrl', function ($resolvedArgs) {
0 ignored issues
show
Bug introduced by
The method addFunction cannot be called on $compiler (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
25
            return '$this->helper->langUrl(' . $resolvedArgs . ')';
26
        });
27
        $compiler->addFunction('image', function ($resolvedArgs) {
0 ignored issues
show
Bug introduced by
The method addFunction cannot be called on $compiler (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
28
            return '(new \Image\Storage(' . $resolvedArgs . '))';
29
        });
30
        $compiler->addFunction('widget', function ($resolvedArgs) {
0 ignored issues
show
Bug introduced by
The method addFunction cannot be called on $compiler (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
31
            return '(new \Application\Widget\Proxy(' . $resolvedArgs . '))';
32
        });
33
34
        $compiler->addFunction('substr', 'substr');
0 ignored issues
show
Bug introduced by
The method addFunction cannot be called on $compiler (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
35
36
    }
37
38
}
39