Skip to content

Commit c82b0d2

Browse files
committed
phpinsights fixes
1 parent 231e8e9 commit c82b0d2

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/Descriptor/Reader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ public function read(): ?Descriptor
3232

3333
$offset = 1;
3434

35-
if (!isset($bytes[$offset])) {
35+
if (! isset($bytes[$offset])) {
3636
throw new Exception('Failed to read buffer entry ' . $offset);
3737
}
3838

3939
$type = $bytes[$offset];
4040
$offset++;
4141
$stdId = Buffer::getString($bytes, 5, $offset);
4242

43-
if (!isset($bytes[$offset])) {
43+
if (! isset($bytes[$offset])) {
4444
throw new Exception('Failed to read buffer entry ' . $offset);
4545
}
4646

src/Util/Buffer.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static function getString(array &$buffer, int $length, int &$offset = 0,
3030
{
3131
$string = '';
3232
for ($i = $offset; $i < $offset + $length; $i++) {
33-
if (!isset($buffer[$i])) {
33+
if (! isset($buffer[$i])) {
3434
throw new Exception('Failed to read buffer entry ' . $i);
3535
}
3636
$string .= chr($buffer[$i]);
@@ -73,7 +73,7 @@ public static function getBytes(array &$buffer, int $length, int &$offset = 0):
7373
{
7474
$datas = '';
7575
for ($i = $offset; $i < $offset + $length; $i++) {
76-
if (!isset($buffer[$i])) {
76+
if (! isset($buffer[$i])) {
7777
throw new Exception('Failed to read buffer entry ' . $i);
7878
}
7979
$datas .= $buffer[$i];
@@ -97,10 +97,10 @@ public static function readBBO(array &$buffer, int $length, int &$offset = 0): i
9797
$len = $length / 2;
9898

9999
for ($i = 0; $i < $len; $i++) {
100-
if (!isset($buffer[$offset + ($len - 1 - $i)])) {
100+
if (! isset($buffer[$offset + ($len - 1 - $i)])) {
101101
throw new Exception('Failed to read buffer entry ' . ($offset + ($len - 1 - $i)));
102102
}
103-
if (!isset($buffer[$offset + $len + $i])) {
103+
if (! isset($buffer[$offset + $len + $i])) {
104104
throw new Exception('Failed to read buffer entry ' . ($offset + $len + $i));
105105
}
106106
$n1 += $buffer[$offset + ($len - 1 - $i)];
@@ -129,7 +129,7 @@ public static function readLSB(array &$buffer, int $length, int &$offset = 0): i
129129
{
130130
$lsb = 0;
131131
for ($i = 0; $i < $length; $i++) {
132-
if (!isset($buffer[$offset + ($length - 1 - $i)])) {
132+
if (! isset($buffer[$offset + ($length - 1 - $i)])) {
133133
throw new Exception('Failed to read buffer entry ' . ($offset + ($length - 1 - $i)));
134134
}
135135

@@ -153,7 +153,7 @@ public static function readMSB(array &$buffer, int $length, int &$offset = 0): i
153153
{
154154
$msb = 0;
155155
for ($i = 0; $i < $length; $i++) {
156-
if (!isset($buffer[$offset + $i])) {
156+
if (! isset($buffer[$offset + $i])) {
157157
throw new Exception('Failed to read buffer entry ' . ($offset + $i));
158158
}
159159
$msb += $buffer[$offset + $i];
@@ -176,11 +176,11 @@ public static function readInt16(array &$buffer, int &$offset = 0): int
176176
{
177177
$output = 0;
178178

179-
if (!isset($buffer[$offset + 0])) {
179+
if (! isset($buffer[$offset + 0])) {
180180
throw new Exception('Failed to read buffer entry ' . ($offset + 0));
181181
}
182182

183-
if (!isset($buffer[$offset + 1])) {
183+
if (! isset($buffer[$offset + 1])) {
184184
throw new Exception('Failed to read buffer entry ' . ($offset + 1));
185185
}
186186

@@ -200,19 +200,19 @@ public static function readInt32(array &$buffer, int &$offset = 0): int
200200
{
201201
$output = 0;
202202

203-
if (!isset($buffer[$offset + 0])) {
203+
if (! isset($buffer[$offset + 0])) {
204204
throw new Exception('Failed to read buffer entry ' . ($offset + 0));
205205
}
206206

207-
if (!isset($buffer[$offset + 1])) {
207+
if (! isset($buffer[$offset + 1])) {
208208
throw new Exception('Failed to read buffer entry ' . ($offset + 1));
209209
}
210210

211-
if (!isset($buffer[$offset + 2])) {
211+
if (! isset($buffer[$offset + 2])) {
212212
throw new Exception('Failed to read buffer entry ' . ($offset + 2));
213213
}
214214

215-
if (!isset($buffer[$offset + 3])) {
215+
if (! isset($buffer[$offset + 3])) {
216216
throw new Exception('Failed to read buffer entry ' . ($offset + 3));
217217
}
218218

0 commit comments

Comments
 (0)