Skip to content
6 changes: 5 additions & 1 deletion wiki/Requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ Additionally, PHP_CodeSniffer requires the following PHP extensions to be enable
- SimpleXML: used to process ruleset XML files
- XMLWriter: used to create some report formats

The following PHP extension is not required, but is strongly recommended:
The following PHP extensions are not required, but are strongly recommended:
- iconv: used for accurate character length calculation in files containing multibyte characters. Without this extension, some sniffs, like `Generic.Files.LineLength`, may report incorrect results for lines containing non-ASCII characters, as PHP_CodeSniffer will fall back to byte-based length calculations.
- PCNTL: required for parallel processing via the `--parallel` CLI option. Without this extension, PHP_CodeSniffer will not be able to check multiple files simultaneously.

> [!WARNING]
> The gRPC PHP extension is known to cause PHP_CodeSniffer to hang when running with parallel processing enabled. If the gRPC extension is loaded, make sure the `grpc.enable_fork_support` and `grpc.poll_strategy` ini settings are properly configured. See [this comment](https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/294#issuecomment-1906558549) for more details.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... looking at this again now, I think it would be better for the docs to include the information for which you now point to an issue.

What do you think ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I configure these settings "properly"? I think the documentation should include that part as well.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks good now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is a good idea, @jrfnl! I've updated the warning to include the workaround directly in the text instead of pointing to the issue.

I used ```text instead of ```bash for the code block as the latter highlights <file|directory> which is not helpful in my opinion for this particular case.

The phpcs command added here triggered a cspell error. I opted to update the cspell markdown_code_block regex pattern to also ignore code blocks inside blockquotes. The previous pattern only matched code blocks starting with optional whitespace, so it didn't match the > ``` syntax used in this warning. Let me know if you prefer a different approach, such as applying this fix in a separate PR or simply adding the word that triggers the error to the allowlist.


Individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options) manual page for a list of these requirements.
Comment thread
jrfnl marked this conversation as resolved.
Outdated
Loading