Skip to content

Mark callable parameters with @param-immediately-invoked-callable#12397

Open
janedbal wants to merge 2 commits intodoctrine:3.6.xfrom
janedbal:param-immediately-invoked-callable
Open

Mark callable parameters with @param-immediately-invoked-callable#12397
janedbal wants to merge 2 commits intodoctrine:3.6.xfrom
janedbal:param-immediately-invoked-callable

Conversation

@janedbal
Copy link
Copy Markdown
Contributor

@janedbal janedbal commented Mar 12, 2026

This adds the @param-immediately-invoked-callable PHPStan annotation to all callable parameters that are invoked immediately.

Changed methods

  • EntityManagerInterface::wrapInTransaction() — callable is invoked immediately within the transaction
  • UnitOfWork::performCallbackOnCachedPersister() — callable is invoked immediately in a loop

…invoked-callable

This allows PHPStan to properly propagate checked exceptions
and impurity from callbacks that are invoked immediately.

See https://phpstan.org/writing-php-code/phpdocs-basics#callables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants