Issues (26)

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/Model/Translation/TranslationCreated.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
declare(strict_types=1);
4
5
/*
6
 * This software may be modified and distributed under the terms
7
 * of the MIT license.  See the LICENSE file for details.
8
 */
9
10
namespace FAPI\PhraseApp\Model\Translation;
11
12
use FAPI\PhraseApp\Model\CreatableFromArray;
13
14
/**
15
 * @author Sascha-Oliver Prolic <[email protected]>
16
 */
17 View Code Duplication
final class TranslationCreated implements CreatableFromArray
0 ignored issues
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
{
19
    /**
20
     * @var string
21
     */
22
    private $id;
23
24
    /**
25
     * @var string
26
     */
27
    private $content;
28
29
    /**
30
     * @var bool
31
     */
32
    private $unverified;
33
34
    /**
35
     * @var bool
36
     */
37
    private $excluded;
38
39
    /**
40
     * @var string
41
     */
42
    private $pluralSuffix;
43
44
    /**
45
     * @var string
46
     */
47
    private $createdAt;
48
49
    /**
50
     * @var string
51
     */
52
    private $updatedAt;
53
54
    /**
55
     * @var array
56
     */
57
    private $placeholders = [];
58
59
    /**
60
     * @var int
61
     */
62
    private $wordCount;
63
64
    /**
65
     * @var Key
66
     */
67
    private $key;
68
69
    /**
70
     * @var Locale
71
     */
72
    private $locale;
73
74
    /**
75
     * @var User
76
     */
77
    private $user;
78
79
    /**
80
     * @param array $data
81
     *
82
     * @return TranslationCreated
83
     */
84
    public static function createFromArray(array $data)
85
    {
86
        $self = new self();
87
88
        if (isset($data['id'])) {
89
            $self->setId($data['id']);
90
        }
91
        if (isset($data['content'])) {
92
            $self->setContent($data['content']);
93
        }
94
        if (isset($data['unverified'])) {
95
            $self->setUnverified($data['unverified']);
96
        }
97
        if (isset($data['excluded'])) {
98
            $self->setExcluded($data['excluded']);
99
        }
100
        if (isset($data['plural_suffix'])) {
101
            $self->setPluralSuffix($data['plural_suffix']);
102
        }
103
        if (isset($data['created_at'])) {
104
            $self->setCreatedAt($data['created_at']);
105
        }
106
        if (isset($data['updated_at'])) {
107
            $self->setUpdatedAt($data['updated_at']);
108
        }
109
        if (isset($data['placeholders'])) {
110
            $self->setPlaceholders($data['placeholders']);
111
        }
112
        if (isset($data['word_count'])) {
113
            $self->setWordCount($data['word_count']);
114
        }
115
        if (isset($data['key']) && is_array($data['key'])) {
116
            $self->setKey(Key::createFromArray($data['key']));
117
        }
118
        if (isset($data['locale']) && is_array($data['locale'])) {
119
            $self->setLocale(Locale::createFromArray($data['locale']));
120
        }
121
        if (isset($data['user']) && is_array($data['user'])) {
122
            $self->setUser(User::createFromArray($data['user']));
123
        }
124
125
        return $self;
126
    }
127
128
    public function getId(): string
129
    {
130
        return $this->id;
131
    }
132
133
    private function setId(string $id)
134
    {
135
        $this->id = $id;
136
    }
137
138
    public function getContent(): string
139
    {
140
        return $this->content;
141
    }
142
143
    private function setContent(string $content)
144
    {
145
        $this->content = $content;
146
    }
147
148
    public function isUnverified(): bool
149
    {
150
        return $this->unverified;
151
    }
152
153
    private function setUnverified(bool $unverified)
154
    {
155
        $this->unverified = $unverified;
156
    }
157
158
    public function isExcluded(): bool
159
    {
160
        return $this->excluded;
161
    }
162
163
    private function setExcluded(bool $excluded)
164
    {
165
        $this->excluded = $excluded;
166
    }
167
168
    public function getPluralSuffix(): string
169
    {
170
        return $this->pluralSuffix;
171
    }
172
173
    private function setPluralSuffix(string $pluralSuffix)
174
    {
175
        $this->pluralSuffix = $pluralSuffix;
176
    }
177
178
    public function getKey(): Key
179
    {
180
        return $this->key;
181
    }
182
183
    private function setKey(Key $key)
184
    {
185
        $this->key = $key;
186
    }
187
188
    public function getCreatedAt(): string
189
    {
190
        return $this->createdAt;
191
    }
192
193
    private function setCreatedAt(string $createdAt)
194
    {
195
        $this->createdAt = $createdAt;
196
    }
197
198
    public function getUpdatedAt(): string
199
    {
200
        return $this->updatedAt;
201
    }
202
203
    private function setUpdatedAt(string $updatedAt)
204
    {
205
        $this->updatedAt = $updatedAt;
206
    }
207
208
    public function getWordCount(): int
209
    {
210
        return $this->wordCount;
211
    }
212
213
    private function setWordCount(int $wordCount)
214
    {
215
        $this->wordCount = $wordCount;
216
    }
217
218
    public function getPlaceholders(): array
219
    {
220
        return $this->placeholders;
221
    }
222
223
    private function setPlaceholders(array $placeholders)
224
    {
225
        $this->placeholders = $placeholders;
226
    }
227
228
    public function getLocale(): Locale
229
    {
230
        return $this->locale;
231
    }
232
233
    private function setLocale(Locale $locale)
234
    {
235
        $this->locale = $locale;
236
    }
237
238
    public function getUser(): User
239
    {
240
        return $this->user;
241
    }
242
243
    private function setUser(User $user)
244
    {
245
        $this->user = $user;
246
    }
247
}
248