Tag::getId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Entity;
6
7
use Doctrine\ORM\Mapping as ORM;
8
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
9
10
/**
11
 * @ORM\Entity(repositoryClass="App\Repository\TagRepository")
12
 * @ORM\Table(name="rw_tag")
13
 *
14
 * @UniqueEntity("name")
15
 */
16
class Tag
17
{
18
    /**
19
     * @ORM\Id()
20
     * @ORM\GeneratedValue()
21
     * @ORM\Column(type="integer")
22
     */
23
    private ?int $id = null;
24
25
    /**
26
     * @ORM\Column(type="string", length=255, unique=true)
27
     */
28
    private string $name;
29
30 1
    public function __toString(): string
31
    {
32 1
        return $this->name;
33
    }
34
35
    public function getId(): ?int
36
    {
37
        return $this->id;
38
    }
39
40 9
    public function getName(): ?string
41
    {
42 9
        return $this->name;
43
    }
44
45 1
    public function setName(string $name): void
46
    {
47 1
        $this->name = $name;
48
    }
49
}
50