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

CampagneManager::getSupport()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
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