Download the PHP package silverassist/coding-standards without Composer
On this page you can find all versions of the php package silverassist/coding-standards. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download silverassist/coding-standards
More information about silverassist/coding-standards
Files in silverassist/coding-standards
Package coding-standards
Short Description Framework-agnostic PHPCS ruleset (PSR-12 + PHPDoc enforcement) and PHPStan base config shared by all Silver Assist PHP projects, WordPress or not.
License PolyForm-Noncommercial-1.0.0
Informations about the package coding-standards
Silver Assist Coding Standards
Framework-agnostic PHPCS ruleset (PSR-12 + mandatory PHPDoc) and a PHPStan base config, shared by every Silver Assist PHP project — WordPress plugin or not.
This package intentionally has zero WordPress dependencies. WordPress
plugins should require silverassist/wp-coding-standards
instead, which requires this package and layers WordPress-Extra, i18n, and
naming-convention sniffs on top.
Install
Installing via Composer (private repository)
SilverAssist packages are installed from their GitHub repositories with a Composer
vcs repository, not from Packagist.org. Those repositories can require
authentication, so always configure a token.
-
Declare the repository in your project's root
composer.json. Composer only readsrepositoriesfrom the root package, so every SilverAssist package your project needs must be listed there, including transitive ones: -
Authenticate with a GitHub token that can read the repository:
- Locally:
composer config --global github-oauth.github.com <token> - CI: set
COMPOSER_AUTH='{"github-oauth":{"github.com":"<token>"}}'from a secret (a GitHub Actions secret or a Bitbucket variable).
Never commit a token or an
auth.json. Without a token, Composer hits GitHub's anonymous API limit (60 requests per hour per IP) and falls back to an SSH clone. - Locally:
- Refresh the lock file if your project commits
composer.lock: runcomposer update --lockafter addingrepositories, so the lock file'scontent-hashmatchescomposer.json.
Troubleshooting
| Symptom | Cause |
|---|---|
Failed to clone the [email protected]:SilverAssist/coding-standards.git repository, try running in interactive mode... followed by Permission denied (publickey) |
The token is missing or has no access to the repository. |
remote: Invalid username or token |
The token is invalid or expired. |
it could not be found in any version |
The vcs entry is missing from the root composer.json. |
Usage — PHPCS
Create a phpcs.xml in your project (this package never scans files
itself — it only ships the rule definitions):
Run it:
Migrating a legacy codebase
If PHPDoc type-hint enforcement is too strict for code that hasn't been
typed yet (see senioradvicecom-wp's strangler-fig migration), exclude
just those two sub-sniffs locally:
Usage — PHPStan
Legacy projects that can't yet run at level 8 can override it after the include:
What's deliberately NOT here
- WordPress sniffs (
WordPress-Extra, i18n, escaping/sanitization,PrefixAllGlobals) — seesilverassist/wp-coding-standards. - The
LoadableInterface/Plugin::instance()bootstrap pattern — seesilverassist/wp-plugin-kernel. - CI/CD workflow templates — those live in
silverassist/wp-coding-standardstoo, since the reference implementations (WordPress Test Suite matrix, release ZIP building) are WordPress-plugin specific. A non-WP project likesenioradvicecom-wpruns PHPCS/PHPStan/PHPUnit directly in its own pipeline instead of via a reusable workflow.
See also
AGENTS.md— instructions for AI coding agents working in this repo.