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

BulkActionGridHelper::renderBulkAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
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\Templating\Helper;
15
16
use Sylius\Component\Grid\Definition\Action;
17
use Sylius\Component\Grid\Renderer\BulkActionGridRendererInterface;
18
use Sylius\Component\Grid\View\GridView;
19
use Symfony\Component\Templating\Helper\Helper;
20
21
/**
22
 * @final
23
 */
24
class BulkActionGridHelper extends Helper
25
{
26
    /**
27
     * @var BulkActionGridRendererInterface
28
     */
29
    private $bulkActionGridRenderer;
30
31
    /**
32
     * @param BulkActionGridRendererInterface $bulkActionGridRenderer
33
     */
34
    public function __construct(BulkActionGridRendererInterface $bulkActionGridRenderer)
35
    {
36
        $this->bulkActionGridRenderer = $bulkActionGridRenderer;
37
    }
38
39
    /**
40
     * @param GridView $gridView
41
     * @param Action $bulkAction
42
     * @param mixed|null $data
43
     *
44
     * @return string
45
     */
46
    public function renderBulkAction(GridView $gridView, Action $bulkAction, $data = null): string
47
    {
48
        return $this->bulkActionGridRenderer->renderBulkAction($gridView, $bulkAction, $data);
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function getName(): string
55
    {
56
        return 'sylius_bulk_action_grid';
57
    }
58
}
59