Completed
Push — 3.1 ( 7e9d2a...4fdd2b )
by Piotr
13:37 queued 13:35
created

CRUDElement   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 1

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setDataGridFactory() 0 4 1
A setDataSourceFactory() 0 4 1
A setFormFactory() 0 4 1
A isFormAware() 0 4 1
A isDataGridAware() 0 4 1
A isDataSourceAware() 0 4 1
1
<?php
2
3
/**
4
 * (c) FSi sp. z o.o. <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace FSi\Bundle\AdminBundle\spec\fixtures\Admin;
13
14
use FSi\Component\DataGrid\DataGridFactoryInterface;
15
use FSi\Component\DataSource\DataSourceFactoryInterface;
16
use Symfony\Component\Form\FormFactoryInterface;
17
18
class CRUDElement extends SimpleAdminElement
19
{
20
    private $dataGridFactory;
21
    private $dataSourceFactory;
22
    private $formFactory;
23
24
    public function setDataGridFactory(DataGridFactoryInterface $factory)
25
    {
26
        $this->dataGridFactory = $factory;
27
    }
28
29
    public function setDataSourceFactory(DataSourceFactoryInterface $factory)
30
    {
31
        $this->dataSourceFactory = $factory;
32
    }
33
34
    public function setFormFactory(FormFactoryInterface $factory)
35
    {
36
        $this->formFactory = $factory;
37
    }
38
39
    public function isFormAware()
40
    {
41
        return isset($this->formFactory);
42
    }
43
44
    public function isDataGridAware()
45
    {
46
        return isset($this->dataGridFactory);
47
    }
48
49
    public function isDataSourceAware()
50
    {
51
        return isset($this->dataSourceFactory);
52
    }
53
}
54