Skip to content

Fix phpstan mixed type in service assertion#2

Merged
f3l1x merged 1 commit into
contributte:masterfrom
ohmyfelix:fix/phpstan-service-assert-type
Feb 13, 2026
Merged

Fix phpstan mixed type in service assertion#2
f3l1x merged 1 commit into
contributte:masterfrom
ohmyfelix:fix/phpstan-service-assert-type

Conversation

@ohmyfelix

Copy link
Copy Markdown
Contributor

Summary

Fix PHPStan errors in McpExtension by making the schema assertion callback safely handle mixed input before calling string-only functions.

Motivation

Scheduled CI started failing in the Phpstan workflow because the callback passed to Expect::string()->assert() forwarded a mixed value directly to str_starts_with(), class_exists(), and interface_exists().

Changes

  • update the service assertion callback in src/DI/McpExtension.php to guard with is_string($input)
  • keep behavior unchanged for valid string service references and class/interface names

Testing

  • make phpstan
  • Full test suite
  • CI passes

@codecov

codecov Bot commented Feb 13, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@f3l1x f3l1x merged commit 0a75e11 into contributte:master Feb 13, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants