Issues (101)

Security Analysis    not enabled

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/History.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\Traits\DeletedByTrait;
6
use Doctrine\ORM\Mapping as ORM;
7
use Gedmo\Mapping\Annotation as Gedmo;
8
use JMS\Serializer\Annotation as Serializer;
9
use Symfony\Component\Validator\Constraints as Assert;
10
11
/**
12
 * @ORM\Table(name="history")
13
 * @ORM\Entity(repositoryClass="App\Repository\HistoryRepository")
14
 * @Gedmo\TranslationEntity(class="App\Entity\Translations\HistoryTranslation")
15
 * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
16
 * @Serializer\ExclusionPolicy("all")
17
 */
18
class History extends AbstractTranslateableStory
19
{
20
    use DeletedByTrait;
21
22
    /**
23
     * @var integer
24
     *
25
     * @ORM\Column(name="id", type="integer")
26
     * @ORM\Id
27
     * @ORM\GeneratedValue(strategy="AUTO")
28
     */
29
    protected $id;
30
31
    /**
32
     * @var /Datetime
33
     *
34
     * @Assert\NotBlank()
35
     * @ORM\Column(type="datetime")
36
     * @Serializer\Type("DateTime")
37
     */
38
    protected $dateTime;
39
40
    /**
41
     * @var int
42
     *
43
     * @Serializer\Type("integer")
44
     * @Serializer\Expose
45
     * @Serializer\Accessor(getter="getYear")
46
     */
47
    protected $year;
48
49
    /**
50
     * @var \Doctrine\Common\Collections\Collection
51
     *
52
     * @ORM\OneToMany(
53
     *     targetEntity="App\Entity\Translations\HistoryTranslation",
54
     *     mappedBy="object",
55
     *     cascade={"persist", "remove"}
56
     * )
57
     */
58
    protected $translations;
59
60
    /**
61
     * @var \App\Entity\GalleryHasMedia
62
     *
63
     * @ORM\ManyToMany(targetEntity="App\Entity\GalleryHasMedia", cascade={"persist"})
64
     * @ORM\JoinTable(name="history_galleryHasMedia",
65
     *     joinColumns={@ORM\JoinColumn(name="history_id",referencedColumnName="id")},
66
     *     inverseJoinColumns={@ORM\JoinColumn(name="galleryHasMedia_id",referencedColumnName="id")}
67
     * )
68
     */
69
    protected $galleryHasMedia;
70
71
    /**
72
     * @var string
73
     *
74
     * @Assert\NotBlank()
75
     * @Assert\Choice(callback = "getTypes", message = "choose_valid_type")
76
     * @ORM\Column(type="string", length=255)
77
     * @Serializer\Type("string")
78
     * @Serializer\Expose
79
     */
80
    protected $type;
81
82
    /**
83
     * @var \Doctrine\Common\Collections\Collection
84
     *
85
     * @Serializer\Expose
86
     * @ORM\OneToMany(targetEntity="App\Entity\Performance", mappedBy="festival", orphanRemoval=true)
87
     */
88
    protected $performances;
89
90
    /**
91
     * Constructor
92
     */
93 1
    public function __construct()
94
    {
95 1
        parent::__construct();
96 1
        $this->galleryHasMedia = new \Doctrine\Common\Collections\ArrayCollection();
97 1
    }
98
99
    /**
100
     * Get id
101
     *
102
     * @return integer
103
     */
104 2
    public function getId()
105
    {
106 2
        return $this->id;
107
    }
108
109
    /**
110
     * Unset translations
111
     *
112
     * @return History
113
     */
114 2
    public function unsetTranslations()
115
    {
116 2
        $this->translations = null;
117
118 2
        return $this;
119
    }
120
121
    /**
122
     * Set dateTime
123
     *
124
     * @param  \DateTime $dateTime
125
     * @return History
126
     */
127
    public function setDateTime($dateTime)
128
    {
129
        $this->dateTime = $dateTime;
130
131
        return $this;
132
    }
133
134
    /**
135
     * Get dateTime
136
     *
137
     * @return \DateTime
138
     */
139 5
    public function getDateTime()
140
    {
141 5
        return $this->dateTime;
142
    }
143
144
    /**
145
     * @return mixed
146
     */
147 4
    public function getYear()
148
    {
149 4
        return $this->getDateTime()->format('Y');
150
    }
151
152
    /**
153
     * Add galleryHasMedia
154
     *
155
     * @param \App\Entity\GalleryHasMedia $galleryHasMedia
156
     * @return self
157
     */
158
    public function addGalleryHasMedia(\App\Entity\GalleryHasMedia $galleryHasMedia)
159
    {
160
        $this->galleryHasMedia[] = $galleryHasMedia;
161
162
        return $this;
163
    }
164
165
    /**
166
     * Remove galleryHasMedia
167
     *
168
     * @param \App\Entity\GalleryHasMedia $galleryHasMedia
169
     */
170
    public function removeGalleryHasMedia(\App\Entity\GalleryHasMedia $galleryHasMedia)
171
    {
172
        $this->galleryHasMedia->removeElement($galleryHasMedia);
0 ignored issues
show
The method removeElement() does not seem to exist on object<App\Entity\GalleryHasMedia>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
173
    }
174
175
    /**
176
     * Get galleryHasMedia
177
     *
178
     * @return \Doctrine\Common\Collections\Collection
179
     */
180 3
    public function getGalleryHasMedia()
181
    {
182 3
        return $this->galleryHasMedia;
183
    }
184
185
    /**
186
     * @return string
187
     */
188 3
    public function getType()
189
    {
190 3
        return $this->type;
191
    }
192
193
    /**
194
     * @param string $type
195
     * @return $this
196
     */
197
    public function setType($type)
198
    {
199
        $this->type = $type;
200
201
        return $this;
202
    }
203
204 2
    public static function getTypes()
205
    {
206 2
        return ['history' => 'history', 'festival' => 'festival'];
207
    }
208
}
209