Skip to content

Commit 2afdf67

Browse files
committed
Ignore some phpstan warning
1 parent 817357b commit 2afdf67

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/MaxMind/Db/Reader/Decoder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ private function decodePointer(int $ctrlByte, int $offset): array
291291
return [$pointer, $offset];
292292
}
293293

294+
// @phpstan-ignore-next-line
294295
private function decodeUint(string $bytes, int $byteLength)
295296
{
296297
if ($byteLength === 0) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public function testTooManyConstructorArgs(): void
5454
public function testNoConstructorArgs(): void
5555
{
5656
$this->expectException(ArgumentCountError::class);
57+
/** @phpstan-ignore-next-line */
5758
new Metadata();
5859
}
5960
}

tests/MaxMind/Db/Test/ReaderTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public function testDecoder(): void
6363
$this->assertSame(-268435456, $record['int32']);
6464
$this->assertSame(100, $record['uint16']);
6565
$this->assertSame(PHP_INT_MAX < 4294967295 && !\extension_loaded('maxminddb') ? '268435456' : 268435456, $record['uint32']);
66+
// @phpstan-ignore-next-line
6667
$this->assertSame(PHP_INT_MAX > 1152921504606846976 && \extension_loaded('maxminddb') ? 1152921504606846976 : '1152921504606846976', $record['uint64']);
6768

6869
$uint128 = $record['uint128'];
@@ -156,6 +157,7 @@ public function testGetWithPrefixLen(): void
156157
'uint128' => \extension_loaded('maxminddb') ? '0x01000000000000000000000000000000' : '1329227995784915872903807060280344576',
157158
'uint16' => 0x64,
158159
'uint32' => PHP_INT_MAX < 4294967295 && !\extension_loaded('maxminddb') ? '268435456' : 268435456,
160+
// @phpstan-ignore-next-line
159161
'uint64' => PHP_INT_MAX > 1152921504606846976 && \extension_loaded('maxminddb') ? 1152921504606846976 : '1152921504606846976',
160162
'utf8_string' => 'unicode! ☯ - ♫',
161163
];
@@ -246,6 +248,7 @@ public function testV6AddressV4Database(): void
246248
{
247249
$this->expectException(InvalidArgumentException::class);
248250
$this->expectExceptionMessage('Error looking up 2001::. You attempted to look up an IPv6 address in an IPv4-only database');
251+
// @phpstan-ignore-next-line
249252
if (\defined('MaxMind\\Db\\Reader::MMDB_LIB_VERSION') && version_compare(Reader::MMDB_LIB_VERSION, '1.2.0', '<')) {
250253
$this->markTestSkipped('MMDB_LIB_VERSION < 1.2.0');
251254
}
@@ -312,6 +315,7 @@ public function testTooManyConstructorArgs(): void
312315
public function testNoConstructorArgs(): void
313316
{
314317
$this->expectException(ArgumentCountError::class);
318+
// @phpstan-ignore-next-line
315319
new Reader();
316320
}
317321

@@ -334,6 +338,7 @@ public function testNoGetArgs(): void
334338
$reader = new Reader(
335339
'tests/data/test-data/MaxMind-DB-test-decoder.mmdb'
336340
);
341+
// @phpstan-ignore-next-line
337342
$reader->get();
338343
}
339344

0 commit comments

Comments
 (0)