TagExtension   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 4
Bugs 0 Features 1
Metric Value
wmc 3
c 4
b 0
f 1
lcom 0
cbo 3
dl 0
loc 22
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFunctions() 0 9 1
A init() 0 3 1
A getName() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Rafidion Michael
5
 * Date: 10/12/2014
6
 * Time: 22:12
7
 */
8
9
namespace Mykees\TagBundle\Twig\Extension;
10
11
class TagExtension extends \Twig_Extension {
12
13
14
    public function getFunctions()
15
    {
16
        return array(
17
            new \Twig_SimpleFunction('mk_tag_javascript', [$this, 'init'], [
18
                'is_safe'=>array('html'),
19
                'needs_environment'=>true
20
            ])
21
        );
22
    }
23
24
    public function init(\Twig_Environment $env){
25
        return  $env->render('MykeesTagBundle:Tpl:javascript.html.twig');
26
    }
27
28
    public function getName()
29
    {
30
        return "mykees_tag_extension";
31
    }
32
}
33