Skip to content

Add pcntl and grpc docs#95

Merged
jrfnl merged 8 commits intomainfrom
add-pcntl-and-grpc-docs
Mar 18, 2026
Merged

Add pcntl and grpc docs#95
jrfnl merged 8 commits intomainfrom
add-pcntl-and-grpc-docs

Conversation

@rodrigoprimo
Copy link
Contributor

Description

Follow-up to #91.

This PR introduces two changes to the Requirements wiki page:

  • Documents PCNTL as a strongly recommended PHP extension, as it is required for parallel processing via the --parallel CLI option.
  • Adds a warning about the gRPC PHP extension, which is known to cause PHP_CodeSniffer to hang when parallel processing is enabled.

Related issues/external references

PR checklist

  • I have checked there is no other PR open for the same change.
  • I have read the Contribution Guidelines.
  • I grant the project the right to include my changes under the BSD-3-Clause license (and I have the right to grant these rights).
  • I have verified that my changes comply with the projects coding standards.
  • [When adding a new Wiki page] I have added the new page to the _Sidebar.md file.
  • [When adding/updating output examples] I have verified via the GitHub Actions artifact that the pre-processing handles the command correctly.

The gRPC PHP extension is known to cause PHP_CodeSniffer to hang
when running with parallel processing enabled.

Refs PHPCSStandards/PHP_CodeSniffer 294
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

=== This is an auto-generated comment ===

Thank you for your PR.
A dry-run has been executed on your PR, executing all markdown pre-processing for the wiki files.

Please review the resulting final markdown files via the created artifact.
This is especially important when adding new pages or updating auto-generated output blocks.

N.B.: the above link will automatically be updated when this PR is updated.

Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @rodrigoprimo !

P.S.: I'll hold off on merging for the moment until you've had a chance to read the discussion between @fredden and me in PHPCSStandards/PHP_CodeSniffer#1388 and indicated how you want to move forward in light of that.

- 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
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 ?

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.

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
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.

@jrfnl
Copy link
Member

jrfnl commented Mar 9, 2026

@derrabus @mbomb007 Just pinging you - the PHPCS wiki docs are being updated to warn about how the gRPC extension can break PHPCS. If you have the chance to look this over and give an opinion on whether this update would have helped you, that would be appreciated!

@mbomb007
Copy link

mbomb007 commented Mar 10, 2026

Personally, I probably wouldn't have seen that information, at least not without a lot of digging. Someone setting up PHPCS will most likely only read the README by scrolling down at https://github.com/PHPCSStandards/PHP_CodeSniffer. In order to get to the updated info on PHP extensions, you have to click the "GitHub wiki" link in the Documentation section, which is pretty generic (and then they have to arrive at the specific section). Perhaps a note pointing to the PHP extension info could be added in the Requirements section of the README? That definitely would have helped me.

@rodrigoprimo rodrigoprimo force-pushed the add-pcntl-and-grpc-docs branch from e627dec to a4120b0 Compare March 13, 2026 12:02
…instead of pointing to the issue

I opted to use "```text" instead of "```bash" as the latter highlights only "<file|directory>" which I don't think helps in this case.
The existing regex pattern for ignoring code blocks only matched
blocks at the start of a line (with optional whitespace). This
update makes it also match code blocks inside markdown
blockquotes, where lines are prefixed with `>`.
@rodrigoprimo
Copy link
Contributor Author

Perhaps a note pointing to the PHP extension info could be added in the Requirements section of the README? That definitely would have helped me.

I think that is a good idea, @mbomb007. I created PHPCSStandards/PHP_CodeSniffer#1393 to discuss how to address your suggestion.

@jrfnl jrfnl merged commit b0fb2a2 into main Mar 18, 2026
14 checks passed
@jrfnl jrfnl deleted the add-pcntl-and-grpc-docs branch March 18, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants