Skip to content

[removal] Remove @api annotations and dead/deprecated public API - #8794

Open
TomasVotruba wants to merge 3 commits into
mainfrom
tv-remove-api-annotations
Open

TomasVotruba wants to merge 3 commits into
mainfrom
tv-remove-api-annotations

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

What

Drops the @api docblock annotations across src/ and rules/, together with the dead public API they used to whitelist.

Removed dead classes:

  • Rector\CodingStyle\ValueObject\ObjectMagicMethods
  • Rector\PhpDocParser\ValueObject\AttributeKey
  • Rector\RuleDoc\CodeSample\ComposerJsonAwareCodeSample
  • Rector\RuleDoc\Contract\Category\CategoryInfererInterface

Removed unused public methods:

  • BetterNodeFinder::findFirstNonAnonymousClass()
  • NodeFactory::createLocalMethodCall()
  • RuleDefinition::setRuleFilePath(), getRuleFilePath(), getRuleShortClass(), isConfigurable()

Removed unused constants on SetList and BridgeItem.

Why

@api only existed to whitelist symbols from the shipmonk dead-code rules. These symbols are no longer used anywhere - core, rules or sibling extension packages - so the annotation hid genuinely dead code. Dropping it together with the dead symbols shrinks the public surface and lets the dead-code analysis cover the rest.

Kept

A few symbols stay, with @api, because they are consumed outside this repo:

  • Set, SetInterface and RuleDefinition::getRuleClass()/setRuleClass() - used by the getrector.com website
  • FixtureTempFileDumper, TestingParser - used by sibling package tests

Decoupled

Larger removals that touched sibling packages were split into their own PRs and already merged: PhpVersionFeature constants, UseNodesToAddCollector, GenericAnnotationToAttributeConverter, RectifiedAnalyzer + created_by_rule, and the deprecated SetProvider/ComposerTriggeredSet/SetGroup/RuleCodeSamplePrinterInterface set.

@TomasVotruba
TomasVotruba force-pushed the tv-remove-api-annotations branch from a395919 to 4304c03 Compare October 23, 2026 22:08
@TomasVotruba TomasVotruba changed the title Remove @api annotations from classes, methods and constants [removal] Remove @api annotations and dead/deprecated public API Oct 23, 2026
@TomasVotruba
TomasVotruba force-pushed the tv-remove-api-annotations branch 8 times, most recently from 55e06ba to 83b1f71 Compare October 24, 2026 09:37
@TomasVotruba
TomasVotruba force-pushed the tv-remove-api-annotations branch from 83b1f71 to 610f4c9 Compare October 24, 2026 09:48
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.

1 participant