Skip to content

Commit dcb7456

Browse files
committed
[Temp] Determine the exception class, hopefully
1 parent 3e270e9 commit dcb7456

2 files changed

Lines changed: 19 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-22.04
1717
strategy:
1818
matrix:
19-
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6' ]
19+
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
2020

2121
steps:
2222
- name: Checkout
@@ -59,7 +59,7 @@ jobs:
5959
strategy:
6060
fail-fast: false
6161
matrix:
62-
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6' ]
62+
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
6363

6464
steps:
6565
- name: Checkout

tests/Unit/PhpStan/IgnoreBooleanAlwaysImpossibleAssertTest.php

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use PHPStan\Analyser\IgnoreErrorExtension;
88
use PHPStan\Rules\Comparison\ImpossibleCheckTypeFunctionCallRule;
99
use PHPStan\Rules\Rule;
10+
use PHPUnit\Framework\Error\Deprecated;
1011

1112
/**
1213
* This covers `function.alreadyNarrowedType` error handling in the `IgnoreBooleanAlways` PHPStan extension class.
@@ -39,15 +40,22 @@ public function warningIsRetainedForPointlessAssert(): void
3940
self::markTestSkipped('This is testing the testers, and only needs to run whenever possible.');
4041
}
4142

42-
// Second argument is array of expected warnings.
43-
$this->analyse(
44-
[self::FIXTURES_DIR . 'alwaystrue-pointlessassert.php'],
45-
[
43+
// TODO: remove try/catch block when PHPStan is fixed.
44+
try {
45+
// Second argument is array of expected warnings.
46+
$this->analyse(
47+
[self::FIXTURES_DIR . 'alwaystrue-pointlessassert.php'],
4648
[
47-
'Call to function is_int() with int will always evaluate to true.',
48-
7,
49-
],
50-
]
51-
);
49+
[
50+
'Call to function is_int() with int will always evaluate to true.',
51+
7,
52+
],
53+
]
54+
);
55+
} catch (Deprecated $e) {
56+
self::markTestSkipped(
57+
'PHPStan has a dependency on an Hoa library that triggers a deprecation warning with PHP 8.6.'
58+
);
59+
}
5260
}
5361
}

0 commit comments

Comments
 (0)