Completed
Push — master ( 79038f...70e595 )
by Łukasz
21s
created

BulkActionGridExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getFunctions() 0 10 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Sylius\Bundle\GridBundle\Twig;
15
16
use Sylius\Bundle\GridBundle\Templating\Helper\BulkActionGridHelper;
17
18
final class BulkActionGridExtension extends \Twig_Extension
19
{
20
    /**
21
     * @var BulkActionGridHelper
22
     */
23
    private $bulkActionGridHelper;
24
25
    /**
26
     * @param BulkActionGridHelper $bulkActionGridHelper
27
     */
28
    public function __construct(BulkActionGridHelper $bulkActionGridHelper)
29
    {
30
        $this->bulkActionGridHelper = $bulkActionGridHelper;
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function getFunctions(): array
37
    {
38
        return [
39
            new \Twig_Function(
40
                'sylius_grid_render_bulk_action',
41
                [$this->bulkActionGridHelper, 'renderBulkAction'],
42
                ['is_safe' => ['html']]
43
            ),
44
        ];
45
    }
46
}
47