Issues (6)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Entity/ToDo.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace App\Entity;
4
5
use App\Repository\ToDoRepository;
6
use Doctrine\Common\Collections\ArrayCollection;
7
use Doctrine\Common\Collections\Collection;
8
use Doctrine\ORM\Mapping as ORM;
9
use Symfony\Component\Serializer\Annotation\Groups;
10
use Symfony\Component\Validator\Constraints as Assert;
11
12
/**
13
 * @ORM\Entity(repositoryClass=ToDoRepository::class)
14
 * @ORM\HasLifecycleCallbacks
15
 */
16
class ToDo
17
{
18
    /**
19
     * @ORM\Id
20
     * @ORM\GeneratedValue(strategy="IDENTITY")
21
     * @ORM\Column(type="integer")
22
     */
23
    private int $id;
0 ignored issues
show
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...
24
25
    /**
26
     * @ORM\Column(type="string")
27
     * @Assert\NotBlank(normalizer = "trim")
28
     * @Groups({"request"})
29
     */
30
    private string $name;
31
32
    /**
33
     * @ORM\Column(type="text", nullable=true)
34
     * @Groups({"request"})
35
     */
36
    private ?string $description = null;
37
38
    /**
39
     * @var Collection|Task[]
40
     * @ORM\OneToMany(targetEntity="Task", mappedBy="todo", orphanRemoval=true, cascade={"all"})
41
     * @Assert\Valid
42
     * @Groups({"request"})
43
     */
44
    private Collection $tasks;
45
46
    /**
47
     * @ORM\Column(type="datetime")
48
     */
49
    private \DateTimeInterface $createdAt;
50
51
    /**
52
     * @ORM\Column(type="datetime")
53
     */
54
    private \DateTimeInterface $updatedAt;
55
56
    public function __construct()
57
    {
58
        $this->tasks = new ArrayCollection();
59
    }
60
61
    public function getId(): int
62
    {
63
        return $this->id;
64
    }
65
66
    public function getName(): string
67
    {
68
        return $this->name;
69
    }
70
71
    public function setName(string $name): self
72
    {
73
        $this->name = $name;
74
75
        return $this;
76
    }
77
78
    public function getDescription(): ?string
79
    {
80
        return $this->description;
81
    }
82
83
    public function setDescription(?string $description): self
84
    {
85
        $this->description = $description;
86
87
        return $this;
88
    }
89
90
    /**
91
     * @return Collection|Task[]
92
     */
93
    public function getTasks(): Collection
94
    {
95
        return $this->tasks;
96
    }
97
98
    public function addTask(Task $task): self
99
    {
100
        if (!$this->tasks->contains($task)) {
101
            $this->tasks[] = $task;
102
            $task->setTodo($this);
103
        }
104
105
        return $this;
106
    }
107
108
    public function removeTask(Task $task): self
109
    {
110
        if ($this->tasks->removeElement($task)) {
111
            // set the owning side to null (unless already changed)
112
            if ($task->getTodo() === $this) {
113
                $task->setTodo(null);
114
            }
115
116
            // Reindex array elements to avoid problems with data serialization
117
            $this->tasks = new ArrayCollection($this->tasks->getValues());
118
        }
119
120
        return $this;
121
    }
122
123
    /**
124
     * @param Collection|Task[] $tasks
125
     */
126
    public function setTasks(Collection $tasks): self
127
    {
128
        $this->tasks->clear();
129
130
        foreach ($tasks as $task) {
131
            $this->addTask($task);
132
        }
133
134
        return $this;
135
    }
136
137
    public function getUpdatedAt(): \DateTimeInterface
138
    {
139
        return $this->updatedAt;
140
    }
141
142
    /**
143
     * @ORM\PrePersist
144
     * @ORM\PreUpdate
145
     */
146
    public function setUpdatedAt(): self
147
    {
148
        $this->updatedAt = new \DateTimeImmutable();
149
150
        return $this;
151
    }
152
153
    public function getCreatedAt(): \DateTimeInterface
154
    {
155
        return $this->createdAt;
156
    }
157
158
    /**
159
     * @ORM\PrePersist
160
     */
161
    public function setCreatedAt(): self
162
    {
163
        $this->createdAt = new \DateTimeImmutable();
164
165
        return $this;
166
    }
167
}
168