Skip to content

Commit 4b4d5ed

Browse files
neildanielsclaude
andcommitted
Silence PHPStan tautology on setOptions() guard
PHPStan resolves OptionsResolver against the installed version (>= 7.3 in CI), where setOptions() exists, so the runtime method_exists() guard appears tautological. Ignore the function.alreadyNarrowedType identifier on that line so the guard remains in place for older OptionsResolver versions allowed by the composer constraint. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1b98f7a commit 4b4d5ed

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎lib/Tmdb/Client.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ protected function configureOptions(array $options)
145145
);
146146

147147
// symfony/options-resolver 8.0 removed nested-options-via-Closure passed to setDefaults();
148-
// setOptions() is the replacement, available from 7.3.
148+
// setOptions() is the replacement, available from 7.3. The runtime guard supports older
149+
// versions still allowed by composer.json; PHPStan resolves against the installed version.
150+
// @phpstan-ignore function.alreadyNarrowedType
149151
if (method_exists($resolver, 'setOptions')) {
150152
$resolver->setOptions('http', $http);
151153
$resolver->setOptions('hydration', $hydration);

0 commit comments

Comments
 (0)