Passed
Push — master ( 32373f...f18c17 )
by Benjamin
05:50 queued 01:43
created

NameTrait::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
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