Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Conversation

@OskarStark
Copy link
Contributor

Summary

This PR updates the PHPStan configuration to use an error identifier instead of a regex pattern for ignoring array type errors in tests.

Changes

  • Replace regex pattern with identifier

Benefits

Using error identifiers is the recommended approach because:

  • More stable: Identifiers don't change across PHPStan versions, unlike error message text
  • Cleaner: Easier to read and understand the intent
  • Maintainable: Less prone to breaking if error message wording changes

Testing

PHPStan analysis passes with the new configuration.

Replace the regex pattern '#no value type specified in iterable type array#'
with the more maintainable error identifier 'missingType.iterableValue'.

Using identifiers is preferred because:
- More stable across PHPStan versions
- Cleaner and easier to understand
- Less prone to breaking if error message wording changes
@OskarStark OskarStark requested a review from chr-hertel July 14, 2025 16:53
Copy link
Member

@chr-hertel chr-hertel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @OskarStark

@chr-hertel chr-hertel merged commit fed405e into main Jul 14, 2025
7 checks passed
@chr-hertel chr-hertel deleted the chore/phpstan-use-identifier branch July 14, 2025 22:17
OskarStark added a commit to symfony/ai that referenced this pull request Jul 15, 2025
…ern (OskarStark)

This PR was merged into the main branch.

Discussion
----------

[Agent] Use PHPStan error identifier instead of regex pattern

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Docs?         | no
| Issues        |
| License       | MIT

Cherry picking php-llm/llm-chain#389

Commits
-------

611206b chore: use PHPStan error identifier instead of regex pattern (#389)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants