GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (12)

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.

lib/UCD/Unicode/Codepoint.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 UCD\Unicode;
4
5
use UCD\Exception\InvalidArgumentException;
6
use UCD\Exception\OutOfRangeException;
7
use UCD\Unicode\TransformationFormat\StringUtility;
8
9
class Codepoint implements Comparable
10
{
11
    const MIN = 0x0;
12
    const MAX = 0x10FFFF;
13
14
    /**
15
     * @var int
16
     */
17
    private $value;
18
19
    /**
20
     * @param int $value
21
     * @throws OutOfRangeException
22
     * @throws InvalidArgumentException
23
     */
24
    private function __construct($value)
25
    {
26
        if (!is_int($value)) {
27
            throw new InvalidArgumentException('Codepoint value must be an integer');
28
        }
29
30
        if ($value < self::MIN || $value > self::MAX) {
31
            throw new OutOfRangeException('Codepoint value must reside between 0x0 and 0x10FFFF');
32
        }
33
34
        $this->value = $value;
35
    }
36
37
    /**
38
     * @param string $value
39
     * @return self
40
     */
41
    public static function fromHex($value)
42
    {
43
        return self::fromInt(hexdec($value));
44
    }
45
46
    /**
47
     * @param int $value
48
     * @return self
49
     */
50
    public static function fromInt($value)
51
    {
52
        return new self($value);
53
    }
54
55
    /**
56
     * @param string $value
57
     * @return self
58
     * @throws InvalidArgumentException
59
     */
60
    public static function fromUTF8($value)
61
    {
62
        return self::fromEncodedCharacter(
63
            $value,
64
            TransformationFormat::ofType(TransformationFormat::EIGHT)
65
        );
66
    }
67
68
    /**
69
     * @param string $value
70
     * @return self
71
     * @throws InvalidArgumentException
72
     */
73
    public static function fromUTF16LE($value)
74
    {
75
        return self::fromEncodedCharacter(
76
            $value,
77
            TransformationFormat::ofType(TransformationFormat::SIXTEEN_LITTLE_ENDIAN)
78
        );
79
    }
80
81
    /**
82
     * @param string $value
83
     * @return self
84
     * @throws InvalidArgumentException
85
     */
86
    public static function fromUTF16BE($value)
87
    {
88
        return self::fromEncodedCharacter(
89
            $value,
90
            TransformationFormat::ofType(TransformationFormat::SIXTEEN_BIG_ENDIAN)
91
        );
92
    }
93
94
    /**
95
     * @param string $value
96
     * @return self
97
     * @throws InvalidArgumentException
98
     */
99
    public static function fromUTF32LE($value)
100
    {
101
        return self::fromEncodedCharacter(
102
            $value,
103
            TransformationFormat::ofType(TransformationFormat::THIRTY_TWO_LITTLE_ENDIAN)
104
        );
105
    }
106
107
    /**
108
     * @param string $value
109
     * @return self
110
     * @throws InvalidArgumentException
111
     */
112
    public static function fromUTF32BE($value)
113
    {
114
        return self::fromEncodedCharacter(
115
            $value,
116
            TransformationFormat::ofType(TransformationFormat::THIRTY_TWO_BIG_ENDIAN)
117
        );
118
    }
119
120
    /**
121
     * @param string $character
122
     * @param TransformationFormat $convertFrom
123
     * @return self
124
     * @throws InvalidArgumentException
125
     */
126
    public static function fromEncodedCharacter($character, TransformationFormat $convertFrom)
127
    {
128
        $convertTo = TransformationFormat::ofType(TransformationFormat::THIRTY_TWO_BIG_ENDIAN);
129
        $character = StringUtility::convertCharacter($character, $convertFrom, $convertTo);
130
        $unpacked = unpack('N', $character);
131
132
        return self::fromInt(
133
            array_shift($unpacked)
134
        );
135
    }
136
137
    /**
138
     * @return string
139
     */
140
    public function toUTF8()
141
    {
142
        return $this->toEncodedCharacter(
143
            TransformationFormat::ofType(TransformationFormat::EIGHT)
144
        );
145
    }
146
147
    /**
148
     * @return string
149
     */
150
    public function toUTF16LE()
151
    {
152
        return $this->toEncodedCharacter(
153
            TransformationFormat::ofType(TransformationFormat::SIXTEEN_LITTLE_ENDIAN)
154
        );
155
    }
156
157
    /**
158
     * @return string
159
     */
160
    public function toUTF16BE()
161
    {
162
        return $this->toEncodedCharacter(
163
            TransformationFormat::ofType(TransformationFormat::SIXTEEN_BIG_ENDIAN)
164
        );
165
    }
166
167
    /**
168
     * @return string
169
     */
170
    public function toUTF32LE()
171
    {
172
        return $this->toEncodedCharacter(
173
            TransformationFormat::ofType(TransformationFormat::THIRTY_TWO_LITTLE_ENDIAN)
174
        );
175
    }
176
177
    /**
178
     * @return string
179
     */
180
    public function toUTF32BE()
181
    {
182
        return $this->toEncodedCharacter(
183
            TransformationFormat::ofType(TransformationFormat::THIRTY_TWO_BIG_ENDIAN)
184
        );
185
    }
186
187
    /**
188
     * @param TransformationFormat $convertTo
189
     * @return string
190
     * @throws InvalidArgumentException
191
     */
192
    public function toEncodedCharacter(TransformationFormat $convertTo)
193
    {
194
        $character = pack('N', $this->value);
195
        $convertFrom = TransformationFormat::ofType(TransformationFormat::THIRTY_TWO_BIG_ENDIAN);
196
197
        return StringUtility::convertCharacter($character, $convertFrom, $convertTo);
198
    }
199
200
    /**
201
     * @return string
202
     */
203
    public function toUnicodeEscape()
204
    {
205
        return sprintf('\u{%X}', $this->value);
206
    }
207
208
    /**
209
     * @return int
210
     */
211
    public function getValue()
212
    {
213
        return $this->value;
214
    }
215
216
    /**
217
     * @param mixed $other
218
     * @return bool
219
     */
220 View Code Duplication
    public function equals($other)
0 ignored issues
show
This method 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...
221
    {
222
        if ($this === $other) {
223
            return true;
224
        }
225
226
        return $other instanceof self
227
            && $this->value === $other->value;
228
    }
229
230
    /**
231
     * @return string
232
     */
233
    public function __toString()
234
    {
235
        return sprintf('U+%X', $this->value);
236
    }
237
}