Completed
Branch v1.x-dev (b0683a)
by Benjamin
08:17
created

NameTrait::setName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Obblm\Core\Entity\Traits;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
trait NameTrait
8
{
9
    /**
10
     * @ORM\Column(type="string", length=255)
11
     */
12
    private $name;
13
14 1
    public function getName(): ?string
15
    {
16 1
        return $this->name;
17
    }
18
19 8
    public function setName(string $name): self
20
    {
21 8
        $this->name = $name;
22
23 8
        return $this;
24
    }
25
26
    public function __toString():?string
27
    {
28
        return $this->getName();
29
    }
30
}
31