CharacterFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 12 1
1
<?php
2
3
namespace App\Factory;
4
5
use App\Entity\Character;
6
7
/**
8
 * Class CharacterFactory
9
 *
10
 * @package App\Factory
11
 */
12
class CharacterFactory
13
{
14
    /**
15
     * @param array $data
16
     *
17
     * @return Character
18
     */
19
    public function create(array $data)
20
    {
21
        $character = new Character();
22
        $character->setCode($data['code'])
23
            ->setName($data['name'])
24
            ->setDescription($data['description'])
25
            ->setSide($data['side'])
26
            ->setImage($data['image'])
27
        ;
28
29
        return $character;
30
    }
31
}
32