Skip to content

Update PHPDoc Types Docs - #14796

Open
phpstan-bot wants to merge 1 commit into
phpstan:2.2.xfrom
phpstan-bot:create-pull-request/patch-fddsl7q
Open

Update PHPDoc Types Docs#14796
phpstan-bot wants to merge 1 commit into
phpstan:2.2.xfrom
phpstan-bot:create-pull-request/patch-fddsl7q

Conversation

@phpstan-bot

Copy link
Copy Markdown
Contributor

This PR documents two PHPDoc types that are resolved by TypeNodeResolver but were not yet mentioned anywhere in the user-facing PHPDoc types reference.

What was done

I compared every type resolved by TypeNodeResolver::resolveIdentifierTypeNode() and TypeNodeResolver::resolveGenericTypeNode() (skipping internal __-prefixed names) against the types documented in website/src/writing-php-code/phpdoc-types.md.

All types were already documented except two closure variants:

  • static-closure — a Closure declared as static, so it does not bind $this.
  • static-pure-closure — a static Closure that additionally has no side effects when called.

Changes

Added both types to the Callables section, next to the existing pure-Closure entry, following the existing concise style with parenthetical descriptions.

- Added `static-closure` and `static-pure-closure` to the Callables section
- These are supported by TypeNodeResolver but were missing from the docs
- `static-closure` is a Closure declared `static` (doesn't bind `$this`);
  `static-pure-closure` is additionally side-effect free
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.

1 participant