Completed
Push — master ( d1711a...bf9da9 )
by Alex
13s
created

Character   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 2
cbo 0
dl 0
loc 32
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getName() 0 4 2
A getNameSlug() 0 4 2
1
<?php
2
3
/**
4
 * This file is part of the PierstovalCharacterManagerBundle package.
5
 *
6
 * (c) Alexandre Rock Ancelet <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Pierstoval\Bundle\CharacterManagerBundle\Entity;
13
14
use Doctrine\ORM\Mapping as ORM;
15
use Pierstoval\Bundle\CharacterManagerBundle\Model\CharacterInterface;
16
17
abstract class Character implements CharacterInterface
18
{
19
    /**
20
     * @var string
21
     *
22
     * @ORM\Column(name="name", type="string", length=255, nullable=false)
23
     */
24
    protected $name;
25
26
    /**
27
     * @var string
28
     *
29
     * @ORM\Column(name="name_slug", type="string", length=255, nullable=false)
30
     */
31
    protected $nameSlug;
32
33
    public function __construct(string $name, string $nameSlug)
34
    {
35
        $this->name = $name;
36
        $this->nameSlug = $nameSlug;
37
    }
38
39
    public function getName(): string
40
    {
41
        return $this->name ?: '';
42
    }
43
44
    public function getNameSlug(): string
45
    {
46
        return $this->nameSlug ?: '';
47
    }
48
}
49