PHP_CodeSniffer icon indicating copy to clipboard operation
PHP_CodeSniffer copied to clipboard

Standards: introduce `prepareInstalledStandardsForDisplay()` method

Open jrfnl opened this issue 8 months ago • 0 comments

Description

This commit introduces a new Standards::prepareInstalledStandardsForDisplay() method. This new method only prepares the "list" into displayable phrases. It doesn't include output formatting with new lines, that's up to the actual display.

This new method allows for getting rid of some output buffering calls in select places.

Includes improving the readability of the "coding standard is not installed" error. Includes deprecating the Standards::printInstalledStandards() method, which is now no longer used by PHPCS itself.

Suggested changelog entry

Deprecated:

  • Standards::printInstalledStandards(). Use echo Standards::prepareInstalledStandardsForDisplay() instead.

Additional context

This is the readability improvement I mention above: image

jrfnl avatar Apr 26 '25 18:04 jrfnl