Consider changing Composer package type to "phpcodesniffer-standard" - #51
Closed
rodrigoprimo wants to merge 248 commits into
Closed
Consider changing Composer package type to "phpcodesniffer-standard"#51rodrigoprimo wants to merge 248 commits into
rodrigoprimo wants to merge 248 commits into
Conversation
setting up few basic rules
* travis: add --fix option to make sure it works (experimental) * [examples+cs] add elements visibility, lowercase elements and method arguments checker * [cs] add various checkers, link topics to docs to make it easy to find origin * [cs] drop consecutive lines checker, breaks 2 lines before class * [cs] disable braces fixer, buggy
Update ValidClass.php
This release's headliner is a new OptimizeGlobalCallsSniff that automatically generates grouped `use function` / `use const` statements for global calls — eliminating runtime namespace fallback overhead and unlocking PHP compiler optimizations. Alongside it, presets can now be fixer-only or sniffer-only without causing errors. `<?php declare(strict_types=1);` is now allowed on the opening line.
dg
force-pushed
the
master
branch
2 times, most recently
from
April 14, 2026 20:11
de36e23 to
e13ccd0
Compare
dg
force-pushed
the
master
branch
2 times, most recently
from
July 13, 2026 14:53
daa0eac to
eaa695a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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"tocomposer.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.