Skip to content

PHPCS: docblocks for every class, method and template - #240

Merged
bordoni merged 10 commits into
mainfrom
docs/phpcs-docblocks
Oct 17, 2026
Merged

bordoni merged 10 commits into
mainfrom
docs/phpcs-docblocks

Conversation

@bordoni

@bordoni bordoni commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Docblocks only: file, class and method docblocks to the WordPress standard, docblocks that contradicted the code corrected, and inline comments as full sentences. After this, vendor/bin/phpcs reports 0 errors and 0 warnings (722 errors and 146 warnings on main).

New docblocks carry @since TBD; #243 sets the ones added in this release to 0.10.0.

Stacked on #239.

@bordoni
bordoni added this pull request to stack #244 October 17, 2026 17:40
@bordoni
bordoni force-pushed the docs/phpcs-docblocks branch 4 times, most recently from a645405 to 6a1a3be Compare October 17, 2026 23:17
@bordoni
bordoni force-pushed the docs/phpcs-docblocks branch from 6a1a3be to 8b30d01 Compare October 17, 2026 23:20
Base automatically changed from fix/phpcs-code to main October 17, 2026 23:22
Mechanical pass over the 189 InvalidEndChar findings, plus three comments rewritten so they say what the code does (the Controller endpoint example, the Lorem Picsum URL example and WP_Term::taxonomy()).
File, class, property and method docblocks for src/FakerPress/Module, written from the code. @inheritdoc on methods with parameters is replaced by full docblocks; @SInCE tags on those reuse the versions already on Interface_Module. Interface_Module::fetch() now documents its real array return and get() its object|null return.
File docblocks for every admin file, class summaries that name the right view (three said 'Class Post_View'), full docblocks for the Admin hook callbacks, Menu param and return descriptions, and the User/Term/Comment format_link() docs now describe users, terms and comments instead of posts.
Templates that start with markup get a leading <?php /** ... */ ?> block; the newline after ?> is swallowed by PHP, so the output is unchanged.
File, class and method docblocks for src/FakerPress/Provider, written from the code. Corrects docs that described other behaviour: WP_Meta::meta_parse_qty() parameters, HTML::html_element_img()/get_img_src() return types and the 20% image reuse rate, and meta_type_lexify() (it calls bothify()).
get_request_var() now documents the real lookup order ($_GET, then $_POST, then $_REQUEST) and points @see at get_in_any(); callback() no longer documents a parameter it does not have.
File, class, property and method docblocks for Plugin, Template, Utils, Assets, Utils\Assets, Hooks, Dates, Ajax and the deprecated Field class. Template::get() said 'Sets'; Assets carried a stray StellarWP\Jobvite package tag; Field's two section banners are gone because PHPCS read them as method docblocks.
@bordoni
bordoni force-pushed the docs/phpcs-docblocks branch from 8b30d01 to 4128040 Compare October 17, 2026 23:22
PHPCS warns that HTML-only files have no PHP code when short_open_tag is off, as on GitHub's runners. The seven empty placeholders and container/end.php get a file docblock; container/end.php still outputs </tr>.
@bordoni
bordoni merged commit 05cb354 into main Oct 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant