Skip to content

[perf] Skip FixClassCaseSensitivityVarDocblockRector for nodes without a docblock - #8626

Merged
TomasVotruba merged 2 commits into
mainfrom
perf-fix-class-case-var-skip-nondoc
Oct 11, 2026
Merged

TomasVotruba merged 2 commits into
mainfrom
perf-fix-class-case-var-skip-nondoc

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Follow-up to the RenameClassRector phpdoc-guard optimization.

FixClassCaseSensitivityVarDocblockRector subscribes to Property and Expression, building a PhpDocInfo for every visited node to correct class-name casing inside @var tags. Those tags only exist in a docblock, so guard the path behind getDocComment() !== null. Without a docblock there is nothing to correct, so behaviour is identical.

Tests: rules-tests/CodeQuality/Rector/Property/FixClassCaseSensitivityVarDocblockRector (4) green, ECS + PHPStan level 8 clean.

TomasVotruba and others added 2 commits October 11, 2026 18:43
…t a docblock

The rule subscribes to Property and Expression and built a PhpDocInfo for every node to fix class-name casing in @var tags. Those tags only exist in a docblock; guard with getDocComment() so the phpdoc work runs only when one exists. Without a docblock there are no var tags to correct, so behaviour is unchanged.
@TomasVotruba
TomasVotruba merged commit 26d724a into main Oct 11, 2026
49 checks passed
@TomasVotruba
TomasVotruba deleted the perf-fix-class-case-var-skip-nondoc branch October 11, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants