DeprecationParserTest
class DeprecationParserTest extends TestCase (View source)
Covers extraction of the deprecation version — #[Deprecated(since:)] and
@_deprecated <version> — into StubsMetadata::getDeprecatedSinceVersion().
Parsing goes through extractAndParseAll() rather than the single-entity parse() convenience
method, because only the former supplies the import map. Resolving Deprecated through
imports is what distinguishes the JetBrains attribute from the built-in one, and the two
order their positional arguments differently.
Methods
No description
Attribute forms are single-line variants of one construct, so the code stays next to the version it is expected to yield. The PhpDoc forms need a docblock and live in fixtures — see {phpDocDeprecationProvider}.
No description
No description
No description
No description
No description
A version is only carried when the element is actually deprecated, so a stale @_deprecated
version can never leak onto a non-deprecated element.
No description
No description
Guards the boundary the filter silently depends on. If the newest supported version ever
stopped being recognised, every @_deprecated <newest> would collapse to null — i.e. to
"deprecated in every version" — which is the widest possible claim and the opposite of
what the tag says. The failure would otherwise be silent.
Details
protected void
setUp()
No description
static array
attributeDeprecationProvider()
Attribute forms are single-line variants of one construct, so the code stays next to the version it is expected to yield. The PhpDoc forms need a docblock and live in fixtures — see {phpDocDeprecationProvider}.
testItParsesDeprecationFromAttributes(string $stubCode, bool $expectedDeprecated, string|null $expectedSince)
No description
static array
phpDocDeprecationProvider()
No description
testItParsesDeprecationFromPhpDoc(string $fixtureFile, string|null $expectedSince)
No description
testItParsesMethodDeprecationVersion()
No description
testItParsesParameterDeprecationVersion()
No description
testItLeavesTheVersionNullWhenNotDeprecated()
A version is only carried when the element is actually deprecated, so a stale @_deprecated
version can never leak onto a non-deprecated element.
static array
phpVersionNormalizationProvider()
No description
testItAcceptsOnlyKnownPhpVersionsFromPhpDoc(string $version, string|null $expected)
No description
testItAcceptsTheNewestAndOldestSupportedPhpVersions()
Guards the boundary the filter silently depends on. If the newest supported version ever
stopped being recognised, every @_deprecated <newest> would collapse to null — i.e. to
"deprecated in every version" — which is the widest possible claim and the opposite of
what the tag says. The failure would otherwise be silent.