Completed
Push — master ( 24d2df...afa2f9 )
by Eric
07:43
created

FormExtraExtension::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Ivory Form Extra package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\FormExtraBundle\Twig;
13
14
use Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode;
15
16
/**
17
 * @author GeLo <[email protected]>
18
 */
19
class FormExtraExtension extends \Twig_Extension
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24 54
    public function getFunctions()
25
    {
26
        $options = [
27 54
            'node_class' => SearchAndRenderBlockNode::class,
28 42
            'is_safe'    => ['html'],
29 42
        ];
30
31
        return [
32 54
            new \Twig_SimpleFunction('form_javascript', null, $options),
33 54
            new \Twig_SimpleFunction('form_stylesheet', null, $options),
34 42
        ];
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40 54
    public function getName()
41
    {
42 54
        return 'ivory_form_extra';
43
    }
44
}
45