Skip to content

Add suggest section to composer.json for recommended extensions#1388

Merged
jrfnl merged 1 commit intoPHPCSStandards:4.xfrom
rodrigoprimo:add-composer-suggest-extensions
Mar 7, 2026
Merged

Add suggest section to composer.json for recommended extensions#1388
jrfnl merged 1 commit intoPHPCSStandards:4.xfrom
rodrigoprimo:add-composer-suggest-extensions

Conversation

@rodrigoprimo
Copy link
Contributor

Description

As suggested in PHPCSStandards/PHP_CodeSniffer-documentation#91 (review), this PR adds ext-iconv and ext-pcntl as suggested extensions in composer.json.

This way, Composer will display these recommendations when installing PHP_CodeSniffer, helping users discover optional extensions that improve functionality.

Suggested changelog entry

Added suggest section to composer.json to inform users about the recommended ext-iconv and ext-pcntl PHP extensions.

Related issues/external references

Related to PHPCSStandards/PHP_CodeSniffer-documentation#91 and PHPCSStandards/PHP_CodeSniffer-documentation#95

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    • This change is only breaking for integrators, not for external standards or end-users.
  • Documentation improvement

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 and distribute the code under the BSD-3-Clause license (and I have the right to grant these rights).
  • I have added tests to cover my changes.
  • I have verified that the code complies with the projects coding standards.
  • [Required for new sniffs] I have added XML documentation for the sniff.
  • I have opened a sister-PR in the documentation repository to update the Wiki.

Add ext-iconv and ext-pcntl as suggested extensions in composer.json.

This way, Composer will display these recommendations when installing
PHP_CodeSniffer, helping users discover optional extensions that
improve functionality.

Refs PHPCSStandards/PHP_CodeSniffer-documentation 91
@fredden
Copy link
Member

fredden commented Mar 6, 2026

This reminds me of squizlabs/PHP_CodeSniffer#3754. Is it within scope to add all the extensions to the 'suggest' list here?

@jrfnl
Copy link
Member

jrfnl commented Mar 6, 2026

This reminds me of squizlabs/PHP_CodeSniffer#3754. Is it within scope to add all the extensions to the 'suggest' list here?

Yes, 💯 . Good call.

@rodrigoprimo Keep the following in mind (from my review of squizlabs/PHP_CodeSniffer#3754:

[jrfnl] As a matter of course, extensions which ship with PHP and can not be disabled do not need to be listed.

@fredden Also reminds me of your offer to verify that those extensions are all used conditionally:

[fredden] Would it be helpful for me to open pull requests for each of the identified extensions, and add a "conditional use" check around these? We could then move these extensions from the require section to suggest.

I'd definitely be happy to see this verified/safeguarded, so I'd welcome PRs handling that. Maybe we should open an issue about it, so we can also track what has been verified, but didn't need a PR ?

If you don't have the bandwidth for this at this time, maybe you could ask @rodrigoprimo if he wants to do that too (open the issue + verify extension usage) ?

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.

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 and indicated how you want to move forward in light of that.

@rodrigoprimo
Copy link
Contributor Author

Thanks for the review, @jrfnl!

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 and indicated how you want to move forward in light of that.

I'd be happy to help with that. @fredden, let me know how you'd like to proceed (either by creating the issue and verifying the extension used, or by asking for my help at any point in this process).

@jrfnl, unless I misunderstood something, I think this PR can be merged. I will wait to hear from @fredden for the next steps.

@jrfnl jrfnl merged commit 6d256e8 into PHPCSStandards:4.x Mar 7, 2026
55 checks passed
@jrfnl jrfnl deleted the add-composer-suggest-extensions branch March 7, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants