Passed
Push — master ( f85738...3d85c1 )
by Peter
04:52
created

GridFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 5
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Admin\Grid\Factory;
6
7
use AbterPhp\Framework\Grid\Component\Actions;
8
use AbterPhp\Framework\Grid\Component\Filters;
9
use AbterPhp\Framework\Grid\Grid;
10
use AbterPhp\Framework\Grid\Pagination\IPagination;
11
use AbterPhp\Framework\Grid\Table\Table;
12
13
class GridFactory
14
{
15
    const ATTRIBUTE_CLASS = 'class';
16
17
    /** @var array */
18
    protected $attributes = [
19
        self::ATTRIBUTE_CLASS => 'grid',
20
    ];
21
22
23
    /**
24
     * @param TableFactory $table
25
     * @param IPagination  $pagination
26
     * @param Filters      $filters
27
     * @param Actions|null $actions
28
     *
29
     * @return Grid
30
     */
31
    public function create(Table $table, IPagination $pagination, Filters $filters, ?Actions $actions): Grid
32
    {
33
        return new Grid($table, $pagination, $filters, $actions, [], $this->attributes);
34
    }
35
}
36