Skip to content

Commit d51e212

Browse files
committed
Run new php-cs-fixer
1 parent e3fab49 commit d51e212

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/MaxMind/Db/Reader/Decoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* We subtract 1 from the log to protect against precision loss.
1414
*/
15-
\define(__NAMESPACE__ . '\_MM_MAX_INT_BYTES', (log(PHP_INT_MAX, 2) - 1) / 8);
15+
\define(__NAMESPACE__ . '\_MM_MAX_INT_BYTES', (log(\PHP_INT_MAX, 2) - 1) / 8);
1616

1717
class Decoder
1818
{
@@ -209,7 +209,7 @@ private function decodeInt32(string $bytes, int $size): int
209209
case 1:
210210
case 2:
211211
case 3:
212-
$bytes = str_pad($bytes, 4, "\x00", STR_PAD_LEFT);
212+
$bytes = str_pad($bytes, 4, "\x00", \STR_PAD_LEFT);
213213
break;
214214
case 4:
215215
break;

tests/MaxMind/Db/Test/Reader/DecoderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ private function pointers(): array
166166
['expected' => 524283, 'input' => [0x2f, 0xf7, 0xfb]],
167167
['expected' => 526335, 'input' => [0x2f, 0xff, 0xff]],
168168
['expected' => 134217726, 'input' => [0x37, 0xf7, 0xf7, 0xfe]],
169-
['expected' => PHP_INT_MAX < 4294967295 ? '2147483647' : 2147483647, 'input' => [0x38, 0x7f, 0xff, 0xff, 0xff]],
170-
['expected' => PHP_INT_MAX < 4294967295 ? '4294967295' : 4294967295, 'input' => [0x38, 0xff, 0xff, 0xff, 0xff]],
169+
['expected' => \PHP_INT_MAX < 4294967295 ? '2147483647' : 2147483647, 'input' => [0x38, 0x7f, 0xff, 0xff, 0xff]],
170+
['expected' => \PHP_INT_MAX < 4294967295 ? '4294967295' : 4294967295, 'input' => [0x38, 0xff, 0xff, 0xff, 0xff]],
171171
];
172172
}
173173

@@ -267,7 +267,7 @@ private function uint32(): array
267267
['expected' => 10872, 'input' => [0xc2, 0x2a, 0x78]],
268268
['expected' => 65535, 'input' => [0xc2, 0xff, 0xff]],
269269
['expected' => 16777215, 'input' => [0xc3, 0xff, 0xff, 0xff]],
270-
['expected' => PHP_INT_MAX < 4294967295 ? '4294967295' : 4294967295, 'input' => [0xc4, 0xff, 0xff, 0xff, 0xff]],
270+
['expected' => \PHP_INT_MAX < 4294967295 ? '4294967295' : 4294967295, 'input' => [0xc4, 0xff, 0xff, 0xff, 0xff]],
271271
];
272272
}
273273

tests/MaxMind/Db/Test/ReaderTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public function testDecoder(): void
6262

6363
$this->assertSame(-268435456, $record['int32']);
6464
$this->assertSame(100, $record['uint16']);
65-
$this->assertSame(PHP_INT_MAX < 4294967295 && !\extension_loaded('maxminddb') ? '268435456' : 268435456, $record['uint32']);
65+
$this->assertSame(\PHP_INT_MAX < 4294967295 && !\extension_loaded('maxminddb') ? '268435456' : 268435456, $record['uint32']);
6666
// @phpstan-ignore-next-line
67-
$this->assertSame(PHP_INT_MAX > 1152921504606846976 && \extension_loaded('maxminddb') ? 1152921504606846976 : '1152921504606846976', $record['uint64']);
67+
$this->assertSame(\PHP_INT_MAX > 1152921504606846976 && \extension_loaded('maxminddb') ? 1152921504606846976 : '1152921504606846976', $record['uint64']);
6868

6969
$uint128 = $record['uint128'];
7070

@@ -114,11 +114,11 @@ public function testMax(): void
114114
$reader = new Reader('tests/data/test-data/MaxMind-DB-test-decoder.mmdb');
115115
$record = $reader->get('::255.255.255.255');
116116

117-
$this->assertSame(INF, $record['double']);
118-
$this->assertSame(INF, $record['float'], 'float');
117+
$this->assertSame(\INF, $record['double']);
118+
$this->assertSame(\INF, $record['float'], 'float');
119119
$this->assertSame(2147483647, $record['int32']);
120120
$this->assertSame(0xFFFF, $record['uint16']);
121-
$this->assertSame(PHP_INT_MAX < 0xFFFFFFFF ? '4294967295' : 0xFFFFFFFF, $record['uint32']);
121+
$this->assertSame(\PHP_INT_MAX < 0xFFFFFFFF ? '4294967295' : 0xFFFFFFFF, $record['uint32']);
122122
$this->assertSame('18446744073709551615', $record['uint64'] . '');
123123

124124
$uint128 = $record['uint128'];
@@ -156,9 +156,9 @@ public function testGetWithPrefixLen(): void
156156
],
157157
'uint128' => \extension_loaded('maxminddb') ? '0x01000000000000000000000000000000' : '1329227995784915872903807060280344576',
158158
'uint16' => 0x64,
159-
'uint32' => PHP_INT_MAX < 4294967295 && !\extension_loaded('maxminddb') ? '268435456' : 268435456,
159+
'uint32' => \PHP_INT_MAX < 4294967295 && !\extension_loaded('maxminddb') ? '268435456' : 268435456,
160160
// @phpstan-ignore-next-line
161-
'uint64' => PHP_INT_MAX > 1152921504606846976 && \extension_loaded('maxminddb') ? 1152921504606846976 : '1152921504606846976',
161+
'uint64' => \PHP_INT_MAX > 1152921504606846976 && \extension_loaded('maxminddb') ? 1152921504606846976 : '1152921504606846976',
162162
'utf8_string' => 'unicode! ☯ - ♫',
163163
];
164164
$tests = [

0 commit comments

Comments
 (0)