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

TemplateManager   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSupport() 0 11 4
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