Skip to content

Consider changing Composer package type to "phpcodesniffer-standard"#7

Open
rodrigoprimo wants to merge 1 commit intotraderinteractive:masterfrom
rodrigoprimo:fix/composer-type
Open

Consider changing Composer package type to "phpcodesniffer-standard"#7
rodrigoprimo wants to merge 1 commit intotraderinteractive:masterfrom
rodrigoprimo:fix/composer-type

Conversation

@rodrigoprimo
Copy link

This PR suggests changing the Composer package type to enable automatic standard registration via the PHPCSStandards Composer installer plugin.

Problem/Motivation

Composer allows declaring a package's type. When no type is declared, the default is "library".

There is a Composer plugin that can install custom PHP_CodeSniffer standards: https://github.com/PHPCSStandards/composer-installer

This plugin is part of the PHPCSStandards organisation, which is the new official home of PHP_CodeSniffer.

For this installer to work, the package type needs to be set to phpcodesniffer-standard.

There are already over 470 packages that use this type. As a side benefit, using this type will allow end-users to more easily find other external PHP_CodeSniffer standards that may be interesting to them when searching on Packagist.

Proposed changes

Add "type": "phpcodesniffer-standard" to composer.json.

This will in no way change the existing behavior of this package for users that do not include the Composer plugin mentioned above in their projects' composer.json.

@rodrigoprimo rodrigoprimo requested a review from a team as a code owner March 12, 2026 15:34
@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ea088a89-27fe-4717-8486-97138e44c487

📥 Commits

Reviewing files that changed from the base of the PR and between b9eb069 and 228a4b7.

📒 Files selected for processing (1)
  • composer.json
📜 Recent review details
🔇 Additional comments (1)
composer.json (1)

4-4: LGTM!

The addition of "type": "phpcodesniffer-standard" is correct and well-justified. This enables automatic registration with the PHPCSStandards/composer-installer plugin while remaining backward-compatible for users who don't use it. The JSON syntax is valid and the placement is appropriate.


Summary by CodeRabbit

  • Chores
    • Updated package metadata to identify the package as a PHP CodeSniffer standard.

Walkthrough

The pull request adds a type field to composer.json with the value phpcodesniffer-standard. This metadata field identifies the package as a PHP CodeSniffer standard for package managers and installation tools.

Changes

Cohort / File(s) Summary
Composer Manifest
composer.json
Added "type": "phpcodesniffer-standard" to identify the package type.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly relates to the main change: adding the phpcodesniffer-standard type to composer.json, which is the core purpose of this PR.
Description check ✅ Passed The description comprehensively explains the rationale, problem context, and proposed change, all directly related to the composer.json type modification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan for PR comments
  • Generate coding plan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant