Completed
Push — master ( 65c91b...7e9231 )
by Guillaume
15:59
created

CampagneManager::getPostOptionResolver()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 16
Code Lines 9

Duplication

Lines 16
Ratio 100 %

Importance

Changes 0
Metric Value
dl 16
loc 16
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 9
nc 2
nop 1
1
<?php
2
3
namespace Starkerxp\CampagneBundle\Manager;
4
5
use Starkerxp\CampagneBundle\Entity\Campagne;
6
use Starkerxp\StructureBundle\Entity\Entity;
7
use Starkerxp\StructureBundle\Manager\AbstractManager;
8
use Symfony\Component\OptionsResolver\OptionsResolver;
9
10
class CampagneManager extends AbstractManager
11
{
12
    public function getSupport(Entity $object)
13
    {
14
        return $object instanceof Campagne;
15
    }
16
17 View Code Duplication
    public function getPostOptionResolver(OptionsResolver $resolver = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
    {
19
        if (empty($resolver)) {
20
            $resolver = new OptionsResolver();
21
        }
22
        $resolver->setRequired(
23
            [
24
                'name',
25
                'type',
26
                'template',
27
                'send_at',
28
            ]
29
        );
30
31
        return $resolver;
32
    }
33
}
34