Skip to content

refactor: remove @see test annotations in source - #10624

Merged
paulbalandan merged 1 commit into
codeigniter4:developfrom
paulbalandan:remove-see-test-annotations
Oct 13, 2026
Merged

paulbalandan merged 1 commit into
codeigniter4:developfrom
paulbalandan:remove-see-test-annotations

Conversation

@paulbalandan

@paulbalandan paulbalandan commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Description
Removes the @see \CodeIgniter\...Test annotation from the class docblock of 127 classes under system/.

The annotations were introduced in #7904 as a side effect of switching Rector to PHPUnitSetList::PHPUNIT_CODE_QUALITY, whose AddSeeTestAnnotationRector generated them. They were never discussed in that PR. Rector has since dropped the rule from the set (rectorphp/rector-phpunit#343), so it is opt-in now and nothing in our Rector config would reintroduce the lines. A dry run over the touched files confirms this.

Reasons to drop the convention:

  • It couples production code to the test tree. Renaming or splitting a test leaves a stale reference that nothing checks.
  • It ships test class names in the framework package, where those classes do not exist.
  • It points the wrong way. PHPUnit's covers metadata is the tool-checked link from tests to the code they test.

Adding #[CoversClass] to the referenced tests was tried in an earlier revision and reverted: PHPUnit then credits each test only with its named class, which zeroed the coverage of collaborators such as exception classes, language files and the Cast classes. Covers metadata will be added per component in follow-ups, with full target lists, before requireCoverageMetadata is enabled.

4.8 carries nine more annotations on classes that do not exist on develop; they are handled in a separate PR.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@carson-codeigniter4 carson-codeigniter4 Bot added the refactor Pull requests that refactor code label Oct 12, 2026
@paulbalandan
paulbalandan force-pushed the remove-see-test-annotations branch from 138c083 to b8baef1 Compare October 13, 2026 05:56
@paulbalandan paulbalandan changed the title refactor: replace @see test annotations in source with #[CoversClass] in tests refactor: remove @see test annotations in source Oct 13, 2026
@paulbalandan

Copy link
Copy Markdown
Member Author

I have updated this PR to just remove the annotation in system/. The adding of the #[CoversClass] attribute will be done in a separate PR.

@paulbalandan
paulbalandan merged commit e0e262a into codeigniter4:develop Oct 13, 2026
61 checks passed
@paulbalandan
paulbalandan deleted the remove-see-test-annotations branch October 13, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Pull requests that refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants