Completed
Push — master ( 74281f...cfb962 )
by Guillaume
03:15 queued 23s
created

TemplateManager::insert()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
dl 10
loc 10
c 0
b 0
f 0
rs 9.4285
cc 3
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace Starkerxp\CampagneBundle\Manager;
4
5
use Starkerxp\CampagneBundle\Entity\Template;
6
use Starkerxp\StructureBundle\Entity\Entity;
7
use Starkerxp\StructureBundle\Manager\AbstractManager;
8
9
class TemplateManager extends AbstractManager
10
{
11
12
    public function getSupport(Entity $object)
13
    {
14
        if (!$object instanceof Template) {
15
            return false;
16
        }
17
        if ($object->getType() == 'email' && empty($object->getMessage())) {
18
            throw new \InvalidArgumentException();
19
        }
20
21
        return $object instanceof Template;
22
    }
23
}
24