Completed
Push — 1.1-coding-standard-fixes ( 71011e...6e4dd7 )
by Kamil
26:05 queued 25:51
created

BulkActionGridHelper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A renderBulkAction() 0 4 1
A getName() 0 4 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\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