Completed
Pull Request — master (#311)
by Łukasz
03:20
created

GenericResourceElement::getRouteParameters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A GenericResourceElement::getSuccessRouteParameters() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * (c) FSi sp. z o.o. <[email protected]>
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
namespace FSi\Bundle\AdminBundle\Admin\ResourceRepository;
13
14
use FSi\Bundle\AdminBundle\Admin\AbstractElement;
15
use Symfony\Component\OptionsResolver\OptionsResolver;
16
17
abstract class GenericResourceElement extends AbstractElement implements Element
18
{
19
    public function getRoute(): string
20
    {
21
        return 'fsi_admin_resource';
22
    }
23
24
    public function getSuccessRoute(): string
25
    {
26
        return $this->getRoute();
27
    }
28
29
    public function getSuccessRouteParameters(): array
30
    {
31
        return $this->getRouteParameters();
32
    }
33
34
    abstract public function getKey(): string;
35
36
    public function getResourceFormOptions(): array
37
    {
38
        return [];
39
    }
40
41
    public function configureOptions(OptionsResolver $resolver): void
42
    {
43
        $resolver->setDefaults([
44
            'template' => null,
45
        ]);
46
47
        $resolver->setAllowedTypes('template', ['null', 'string']);
48
    }
49
}
50