Completed
Branch v1.x-dev (5c2708)
by Benjamin
04:14
created

NameTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 42.86%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 22
ccs 3
cts 7
cp 0.4286
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setName() 0 5 1
A __toString() 0 3 1
A getName() 0 3 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
    public function getName(): ?string
15
    {
16
        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