Completed
Push — master ( 8c5aef...11380b )
by Guillaume
03:14
created

EventManager   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSupport() 0 4 1
A toArray() 0 8 1
1
<?php
2
3
namespace Starkerxp\CampagneBundle\Manager;
4
5
use Starkerxp\CampagneBundle\Entity\Event;
6
use Starkerxp\StructureBundle\Entity\Entity;
7
use Starkerxp\StructureBundle\Manager\AbstractManager;
8
9
class EventManager extends AbstractManager
10
{
11
12
    public function getSupport(Entity $object)
13
    {
14
        return $object instanceof Event;
15
    }
16
17
    public function toArray(Event $object, $fields = [])
18
    {
19
        $array = [
20
            "id"       => $object->getId(),
21
            "campagne_id" => $object->getCampagne()->getId(),
22
        ];
23
        return $this->exportFields($array, $fields);
24
    }
25
}
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...
26