Skip to content

Commit 4802c97

Browse files
neildanielsclaude
andcommitted
Cover both PHPStan identifiers on method_exists guard
The method_exists() guard evaluates to true on PHP >= 8.2 (installs options-resolver 7.3+ where setOptions exists) and false on PHP < 8.2 (installs 4.4-7.2 where it doesn't). PHPStan reports different identifiers per outcome (function.alreadyNarrowedType vs function.impossibleType). List both in the inline ignore so the relevant one matches on each PHP version in the CI matrix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0e66d7d commit 4802c97

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎lib/Tmdb/Client.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ protected function configureOptions(array $options)
147147
// symfony/options-resolver 8.0 removed nested-options-via-Closure passed to setDefaults();
148148
// setOptions() is the replacement, available from 7.3. The runtime guard supports older
149149
// versions still allowed by composer.json; PHPStan resolves against the installed version.
150-
// @phpstan-ignore function.alreadyNarrowedType
150+
// @phpstan-ignore function.alreadyNarrowedType, function.impossibleType
151151
if (method_exists($resolver, 'setOptions')) {
152152
$resolver->setOptions('http', $http);
153153
$resolver->setOptions('hydration', $hydration);

0 commit comments

Comments
 (0)