Issues (2)

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/Model/Media.php (1 issue)

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 MediaBundle\Model;
4
5
use Symfony\Component\HttpFoundation\File\File;
6
7
abstract class Media
0 ignored issues
show
Media does not seem to conform to the naming convention (^Abstract|Factory$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
8
{
9
10
    /**
11
     *
12
     * @var int
13
     */
14
    protected $id;
15
    
16
    /**
17
     *
18
     * @var File
19
     */
20
    protected $file;
21
    
22
    /**
23
     *
24
     * @var string
25
     */
26
    protected $filename;
27
    
28
    /**
29
     *
30
     * @var string
31
     */
32
    protected $format;
33
34
    /**
35
     *
36
     * @var array
37
     */
38
    protected $metadata;
39
40
    /**
41
     *
42
     * @var \DateTime
43
     */
44
    protected $updatedAt;
45
46
    /**
47
     *
48
     * @var \DateTime
49
     */
50
    protected $createdAt;
51
52
    /**
53
     * 
54
     * @return string
55
     */
56
    public function __toString()
57
    {
58
        return (string) $this->getFilename();
59
    }
60
    
61
    /**
62
     * 
63
     * @return int
64
     */
65
    public function getId()
66
    {
67
        return $this->id;
68
    }
69
    
70
    /**
71
     * 
72
     * @param File $file
73
     * 
74
     * @return $this
75
     */
76
    public function setFile(File $file)
77
    {
78
        $this->file = $file;
79
        
80
        return $this;
81
    }
82
    
83
    /**
84
     * 
85
     * @return File
86
     */
87
    public function getFile()
88
    {
89
        return $this->file;
90
    }
91
    
92
    public function preUpdate()
93
    {
94
        $this->updatedAt = new \DateTime();
95
    }
96
    
97
    public function prePersist()
98
    {
99
        $this->updatedAt = new \DateTime();
100
        $this->createdAt = new \DateTime();
101
    }
102
    
103
    /**
104
     * Set filename
105
     *
106
     * @param string $filename
107
     *
108
     * @return Media
109
     */
110
    public function setFilename($filename)
111
    {
112
        $this->filename = $filename;
113
114
        return $this;
115
    }
116
117
    /**
118
     * Get filename
119
     *
120
     * @return string
121
     */
122
    public function getFilename()
123
    {
124
        return $this->filename;
125
    }
126
127
    /**
128
     * Set format
129
     *
130
     * @param string $format
131
     *
132
     * @return Media
133
     */
134
    public function setFormat($format)
135
    {
136
        $this->format = $format;
137
138
        return $this;
139
    }
140
141
    /**
142
     * Get format
143
     *
144
     * @return string
145
     */
146
    public function getFormat()
147
    {
148
        return $this->format;
149
    }
150
151
    /**
152
     * Set metadata
153
     *
154
     * @param array $metadata
155
     *
156
     * @return Media
157
     */
158
    public function setMetadata($metadata)
159
    {
160
        $this->metadata = $metadata;
161
162
        return $this;
163
    }
164
165
    /**
166
     * Get metadata
167
     *
168
     * @return array
169
     */
170
    public function getMetadata()
171
    {
172
        return $this->metadata;
173
    }
174
175
    /**
176
     * Set updatedAt
177
     *
178
     * @param \DateTime $updatedAt
179
     *
180
     * @return Media
181
     */
182
    public function setUpdatedAt($updatedAt)
183
    {
184
        $this->updatedAt = $updatedAt;
185
186
        return $this;
187
    }
188
189
    /**
190
     * Get updatedAt
191
     *
192
     * @return \DateTime
193
     */
194
    public function getUpdatedAt()
195
    {
196
        return $this->updatedAt;
197
    }
198
199
    /**
200
     * Set createdAt
201
     *
202
     * @param \DateTime $createdAt
203
     *
204
     * @return Media
205
     */
206
    public function setCreatedAt($createdAt)
207
    {
208
        $this->createdAt = $createdAt;
209
210
        return $this;
211
    }
212
213
    /**
214
     * Get createdAt
215
     *
216
     * @return \DateTime
217
     */
218
    public function getCreatedAt()
219
    {
220
        return $this->createdAt;
221
    }
222
223
}
224