Character   A
last analyzed

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