TemplateManager   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSupport() 0 4 2
A toArray() 0 12 1
1
<?php
2
3
namespace Starkerxp\CampaignBundle\Manager;
4
5
use Starkerxp\CampaignBundle\Entity\Template;
6
use Starkerxp\StructureBundle\Entity\AbstractEntity;
7
use Starkerxp\StructureBundle\Manager\AbstractManager;
8
9
class TemplateManager extends AbstractManager
10
{
11
12
    public function getSupport(AbstractEntity $object)
13
    {
14
        return is_object($object) && $object instanceof Template;
15
    }
16
17
    public function toArray(Template $object, $fields = [])
18
    {
19
        $array = [
20
            "id" => $object->getId(),
21
            "name" => $object->getName(),
22
            "type" => $object->getType(),
23
            "object" => $object->getObject(),
24
            "message" => $object->getMessage(),
25
        ];
26
27
        return $this->exportFields($array, $fields);
28
    }
29
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
30