This is a follow-up to squizlabs/PHP_CodeSniffer#3754. See also #1388.
The lists of PHP extensions in composer.json's "require" and "suggest" sections are incomplete. Running maglnet/composer-require-checker as described in squizlabs/PHP_CodeSniffer#3754 on this codebase (as at 8b1c267) yields the following issues (and a long list of PHP_CodeSniffer-internal T_* constants).
ComposerRequireChecker 4.0.1-111-g8b1c26745-dev
The following unknown symbols were found:
+-------------------------------------------------------+--------------------+
| unknown symbol | guessed dependency |
+-------------------------------------------------------+--------------------+
| Composer\Autoload\ClassLoader | |
| PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase | |
| PHP_CodeSniffer\Tests\ConfigDouble | |
| PHP_CODESNIFFER_VERBOSITY | |
| PHP_CODESNIFFER_CBF | |
| iconv_strlen | ext-iconv |
| libxml_use_internal_errors | ext-libxml |
| libxml_get_errors | ext-libxml |
| libxml_clear_errors | ext-libxml |
| json_encode | ext-json |
| iconv | ext-iconv |
| DOMElement | ext-dom |
| DOMDocument | ext-dom |
| DOMNode | ext-dom |
| json_decode | ext-json |
| posix_isatty | ext-posix |
| pcntl_fork | ext-pcntl |
| pcntl_waitpid | ext-pcntl |
| pcntl_wexitstatus | ext-pcntl |
+-------------------------------------------------------+--------------------+
✅ \Composer\Autoload\ClassLoader
No action required here.
The use of this class is wrapped in suitable safeguarding code.
✅ PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase and PHP_CodeSniffer\Tests\ConfigDouble
No action required here.
These show up due to the way that I wrote the temporary 'autoload' section within composer.json and can safely be ignored.
This is a feature of the filesystem layout, having tests for each standard within the src/ directory.
✅ PHP_CODESNIFFER_VERBOSITY and PHP_CODESNIFFER_CBF
No action required here.
These are internal PHP_CodeSniffer constants which are always defined in the entrypoints used to run PHP_CodeSniffer.
Similarly, there is a long list of T_* constants which showed up in the tool output, which I have validated and removed before opening this issue.
🔲 ext-dom
This extension is used within the "generator" feature, and is used by all three generators (HTML, Markdown, Text).
While this extension is enabled by default within PHP, it is possible to disable it at compile time.
Actions required:
🔲 ext-iconv
Actions required:
🔲 ext-json
This extension is used without suitable checks in the 'json' report and the cache feature.
While this extension is enabled by default within PHP, it is possible to disable it at compile time for PHP versions below 8.0.
(From PHP 8.0 and above, this extension can no longer be disabled.)
Actions required:
🔲 ext-libxml
This extension is a requirement of the SimpleXML extension which we already declare a depenency on.
While this extension is enabled by default within PHP, it is possible to disable it at compile time.
Actions required:
🔲 ext-pcntl
This extension is not currently available on Windows. This extension powers the "parallel" feature.
We already detect the existence of this extension and silently disable the parallel feature. I have discussed this with @jrfnl and we have agreed that this "automatic disable" should remain silent.
Actions required:
✅ ext-posix
No action required here.
This is used in exactly one place within the codebase (\PHP_CodeSniffer\Util\Common::isStdinATTY()). It is wrapped in a suitable check, and the code safely falls back to other methods to detect if the output will be going to a terminal or not.
This is a follow-up to squizlabs/PHP_CodeSniffer#3754. See also #1388.
The lists of PHP extensions in
composer.json's "require" and "suggest" sections are incomplete. Runningmaglnet/composer-require-checkeras described in squizlabs/PHP_CodeSniffer#3754 on this codebase (as at 8b1c267) yields the following issues (and a long list of PHP_CodeSniffer-internalT_*constants).✅
\Composer\Autoload\ClassLoaderNo action required here.
The use of this class is wrapped in suitable safeguarding code.
✅
PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCaseandPHP_CodeSniffer\Tests\ConfigDoubleNo action required here.
These show up due to the way that I wrote the temporary 'autoload' section within
composer.jsonand can safely be ignored.This is a feature of the filesystem layout, having tests for each standard within the
src/directory.✅
PHP_CODESNIFFER_VERBOSITYandPHP_CODESNIFFER_CBFNo action required here.
These are internal PHP_CodeSniffer constants which are always defined in the entrypoints used to run PHP_CodeSniffer.
Similarly, there is a long list of
T_*constants which showed up in the tool output, which I have validated and removed before opening this issue.🔲 ext-dom
This extension is used within the "generator" feature, and is used by all three generators (HTML, Markdown, Text).
While this extension is enabled by default within PHP, it is possible to disable it at compile time.
Actions required:
🔲 ext-iconv
Actions required:
Reportinterface (with a default value, thus making this feature optional). Reports will use this constant to declare what PHP extensions they require in order to operate properly.iconvto the list of "required extensions" for the 'checkstyle' report.iconvto the list of "required extensions" for the 'junit' report.iconvto the list of "required extensions" for the 'xml' report.🔲 ext-json
This extension is used without suitable checks in the 'json' report and the cache feature.
While this extension is enabled by default within PHP, it is possible to disable it at compile time for PHP versions below 8.0.
(From PHP 8.0 and above, this extension can no longer be disabled.)
Actions required:
jsonto the list of "required extensions" for the 'json' report. (See above for details of this new "required extensions" list.)🔲 ext-libxml
This extension is a requirement of the
SimpleXMLextension which we already declare a depenency on.While this extension is enabled by default within PHP, it is possible to disable it at compile time.
Actions required:
ext-libxmlto the "require" section ofcomposer.json. - PR Composer: clarify that the PHPlibxmlextension is required #1409libxmlto the list of required extensions inrequirements.phpand its associated tests. - PR Wiki/Requirements: improve information about required PHP extensions PHP_CodeSniffer-documentation#97🔲 ext-pcntl
This extension is not currently available on Windows. This extension powers the "parallel" feature.
We already detect the existence of this extension and silently disable the parallel feature. I have discussed this with @jrfnl and we have agreed that this "automatic disable" should remain silent.
Actions required:
✅ ext-posix
No action required here.
This is used in exactly one place within the codebase (
\PHP_CodeSniffer\Util\Common::isStdinATTY()). It is wrapped in a suitable check, and the code safely falls back to other methods to detect if the output will be going to a terminal or not.