Test Failed
Push — master ( c1d2e0...874a5e )
by Sven
13:19
created

Task   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 7
eloc 15
c 3
b 0
f 0
dl 0
loc 69
rs 10
1
<?php
2
3
namespace App\Entity;
4
5
use App\Repository\TaskRepository;
6
use Doctrine\ORM\Mapping as ORM;
7
use Symfony\Component\Serializer\Annotation\Groups;
8
use Symfony\Component\Serializer\Annotation\Ignore;
9
use Symfony\Component\Validator\Constraints as Assert;
10
11
/**
12
 * @ORM\Entity(repositoryClass=TaskRepository::class)
13
 */
14
class Task
15
{
16
    /**
17
     * @ORM\Id
18
     * @ORM\GeneratedValue(strategy="IDENTITY")
19
     * @ORM\Column(type="integer")
20
     * @Ignore()
21
     */
22
    private int $id;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
23
24
    /**
25
     * @ORM\Column(type="string", length=255)
26
     * @Assert\NotBlank(normalizer = "trim")
27
     * @Groups({"request"})
28
     */
29
    private string $name;
30
31
    /**
32
     * @ORM\Column(type="text", nullable=true)
33
     * @Groups({"request"})
34
     */
35
    private ?string $description = null;
36
37
    /**
38
     * @ORM\ManyToOne(targetEntity="ToDo", inversedBy="tasks")
39
     * @ORM\JoinColumn(nullable=false)
40
     * @Ignore()
41
     */
42
    private ?ToDo $todo;
43
44
    public function getId(): int
45
    {
46
        return $this->id;
47
    }
48
49
    public function getName(): string
50
    {
51
        return $this->name;
52
    }
53
54
    public function setName(string $name): self
55
    {
56
        $this->name = $name;
57
58
        return $this;
59
    }
60
61
    public function getDescription(): ?string
62
    {
63
        return $this->description;
64
    }
65
66
    public function setDescription(?string $description): self
67
    {
68
        $this->description = $description;
69
70
        return $this;
71
    }
72
73
    public function getTodo(): ?ToDo
74
    {
75
        return $this->todo;
76
    }
77
78
    public function setTodo(?ToDo $todo): self
79
    {
80
        $this->todo = $todo;
81
82
        return $this;
83
    }
84
}
85