DeprecationParser
class DeprecationParser (View source)
Extracts deprecation state — the flag and the PHP version it starts at — from a stub element.
Two distinct attributes mark deprecation in the stubs, and their positional arguments differ:
JetBrains\PhpStorm\Deprecated($reason, $replacement, $since)—sinceis argument 2.- the built-in
\Deprecated(?string $message, ?string $since)(PHP 8.4+) —sinceis argument 1. The namedsince:form is what the stubs overwhelmingly use, but positional args are read too, per flavour, so a positionalsinceis never mistaken for a replacement or a message.
Precedence mirrors {\StubTests\Framework\Parsers\Stubs\Versions\DefaultAvailableVersionParser}: an attribute overrides the PhpDoc tag.
Constants
| private FLAVOUR_JETBRAINS |
|
| private FLAVOUR_BUILTIN |
|
| private SINCE_POSITION |
Position of the |
Methods
No description
Is $version one of the PHP versions this suite validates?
Details
ParsedDeprecation
parseDeprecation(array $attributes, array $imports = [], ParsedPhpDoc|null $phpDoc = null)
No description
static string|null
normalizePhpVersion(string $version)
Is $version one of the PHP versions this suite validates?
Used to filter the @_deprecated PhpDoc tag, whose leading token is a PHP version on some
entries (@_deprecated 7.1) but a library version on others (@_deprecated 2.3.0 use ...,
for PECL extensions that version independently of PHP). Only recognised PHP versions are
accepted, so a library version is never read as a language level. A patch component is
tolerated — @_deprecated 7.0.7 narrows to 7.0 — because deprecation is tracked per minor.