PHPCSStandards / PHPCSUtils

A suite of utility functions for use with PHP_CodeSniffer
https://phpcsutils.com/
GNU Lesser General Public License v3.0
53 stars 7 forks source link

UtilityMethodTestCase: performance improvement #525

Closed jrfnl closed 9 months ago

jrfnl commented 9 months ago

PR squizlabs/PHP_CodeSniffer#3831 / PHPCSStandards/PHP_CodeSniffer#61 in PHPCS itself makes a change to improve the performance of the Config class.

This commit lets the UtilityMethodTestCase take advantage of that performance improvement by explicitly passing the report_width to prevent a call to shell_exec('stty ...') from being made and slowing down the tests.

While not benchmarked properly, with the test runs for PHPCSUtils on my local machine on Windows, the difference this change makes is significant and noticable:

This advantage can only be seen with PHPCS 3.8.0 or higher, but the change does not negatively impact test runs against PHPCS < 3.8.0, so there is no need to raise the minimum PHPCS version.