Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for global constants #7006

Merged
merged 1 commit into from Apr 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions website/src/writing-php-code/phpdoc-types.md
Expand Up @@ -272,6 +272,16 @@ Constant enumerations are also supported:
* `self::SOME_*` (all constants on `self` that start with `SOME_`)
* `Foo::*` (all constants on `Foo`)

Global constants
-------------------------

<div class="text-xs inline-block border border-green-600 text-green-600 bg-green-100 rounded px-1 mb-4">Available in PHPStan 1.6</div>

Constants are supported as long as they don't contain lowercase letters and a class with the same name doesn't exist:

* `SOME_CONSTANT`
* `SOME_CONSTANT|OTHER_CONSTANT`

Callables
-------------------------

Expand Down