Character::getNameSlug()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
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