Download the PHP package sympress/coding-standards without Composer

On this page you can find all versions of the php package sympress/coding-standards. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package coding-standards

SymPress Coding Standards

Checks Release PHP Downloads

SymPress PHP coding standards for WordPress projects built with Symfony-level application structure.

SymPress Coding Standards is a PHP_CodeSniffer ruleset package for modern WordPress projects. It combines custom SymPress sniffs with established PHPCS standards for PHP, WordPress, WordPress VIP, PHP compatibility, variable analysis, array normalization, and modern PHP practices.

The package is designed for projects that keep domain and application code framework-agnostic while isolating WordPress integration at explicit boundaries.

Table of Contents

Requirements

The SymPress Coding Standards package requires:

The enterprise profiles make the target PHP and WordPress support level explicit. Run PHP_CodeSniffer on a PHP runtime that can tokenize the syntax used by the project being checked.

When installed for local development, this package also declares PHPUnit and PHPStan-related development dependencies.

Installation

Installing this package with Composer installs the required PHPCS standards and registers them through the PHP_CodeSniffer Standards Composer Installer plugin.

Local Installation

Install the package in a project:

Global Installation

The package can also be installed globally:

Verify Installation

Verify that PHP_CodeSniffer discovered the standards:

The output should include the SymPress standards:

Standards Basis

SymPress Coding Standards is intentionally not a fully custom style dialect. It starts from official and widely adopted PHP_CodeSniffer standards, then adds SymPress-specific rules where WordPress projects with a Symfony-style application structure need sharper boundaries.

The formatting baseline follows PSR-12 and the PSR rules bundled with PHP_CodeSniffer. Import layout follows the PSR-12 header model: class imports, function imports, and constant imports are separate blocks, with a single blank line between blocks.

The pure PHP layer also uses Slevomat Coding Standard for modern PHP practices. Fully qualified global function calls are normalized to explicit function imports. This keeps global function references explicit and compiler-friendly while avoiding leading backslashes throughout implementation code.

WordPress-facing profiles build on established WordPress ecosystem standards: WordPress Coding Standards, selected WordPress VIP checks, PHPCompatibility, PHPCSExtra, PHPCSUtils, and VariableAnalysis. SymPress rules sit on top of those foundations to express package boundaries, architecture preferences, and project-level migration posture.

Rulesets

This package contains these rulesets:

The SymPress-Pure layer is intentionally free of WordPress globals. Use SymPress-Boundary only where WordPress requires procedural entrypoints or direct integration code.

WordPress-specific allowances stay outside the pure layer. For example, SymPress-WordPress configures SymPress.Files.LineLength to tolerate long literal strings passed to WordPress i18n functions, while SymPress-Pure keeps the line-length rule framework-neutral.

Base layers such as SymPress-Pure, SymPress-WordPress, SymPress-Boundary, and SymPress-Templates are version-neutral. Use an enterprise profile or project-level testVersion and minimum_wp_version settings to define compatibility.

Enterprise Profiles

New enterprise projects should choose an explicit compatibility profile:

Profile Use when Target
SymPress-Enterprise-LTS A large legacy codebase needs conservative rollout and warning-first architecture rules. WordPress 6.5+
SymPress-Enterprise-Modern A current enterprise project wants strict security and correctness without forcing every style preference immediately. PHP 8.4+, WordPress 7.0+
SymPress-Enterprise-Next A new package or greenfield project intentionally tracks the newest supported stack. PHP 8.5+, WordPress 7.0+

See docs/Rules.md for the full strategy.

Usage

Command Line

Run PHP_CodeSniffer with a standard directly:

Run the recommended enterprise default:

Run only the framework-agnostic layer:

Run template rules for a specific file. Prefer a project ruleset so the compatibility target is explicit:

Use -s to display sniff codes:

Custom Ruleset

Like any PHP_CodeSniffer standard, SymPress can be referenced from a phpcs.xml.dist file.

A minimal configuration:

A fuller project configuration with boundary and template layers:

Using a default ruleset keeps command-line usage simple:

Any command-line option passed to phpcs overrides the matching value from the ruleset.

Customization

SymPress sniffs can be configured with PHPCS properties where the sniff exposes public configuration.

Example: change the maximum function length:

Example: change class and file length guardrails:

Example: configure PSR-4 checks:

Example: allow additional short variable or parameter names:

SymPress expects data accessors to use framework-friendly getter and setter names. Prefer:

Instead of property-style reads or behavior-like names for direct data assignment:

The rule is exposed as SymPress.Classes.AccessorNaming. For concrete methods, it reports only simple direct accessors such as return $this->title; or $this->title = $title; with no additional statements. For abstract/interface signatures without a body, it falls back to property-like read names and setter-like command prefixes. Boolean reads may use predicate getter names such as isActive() and hasChildren(). PHP property hooks using get and set blocks are supported and are treated as property syntax, not method accessor violations.

SymPress also reports redundant temporary variables that are assigned only to be used by a following return, throw, echo, print, or yield statement. Prefer:

Instead of:

The rule is exposed as SymPress.Variables.RedundantAssignment and complements SlevomatCodingStandard.Variables.UselessVariable. It is intentionally aggressive: it also reports assignments made before unrelated business code and assignments whose right-hand side is a method or function call when the assigned variable is only used by the final statement.

See docs/Sniffs.md for the custom SymPress sniff list.

Auto-Fixing

Some rules can be fixed automatically with PHP_CodeSniffer's fixer:

Custom fixer output is covered by regression tests. Use automatic fixing deliberately and review the diff afterwards.

Disabling or Excluding Rules

Prefer ruleset-level exclusions over inline comments. This keeps intentional deviations visible in review.

Disable a rule for the whole project:

Disable a rule for a path:

Use inline ignores only for narrow, local exceptions:

More examples are available in docs/Disabling.md.

IDE Integration

For PhpStorm, configure PHP_CodeSniffer under:

Point the tool to vendor/bin/phpcs, validate the path, then enable:

Refresh the coding standard list and select SymPress-Enterprise-Modern, SymPress-Plugin, SymPress-Pure, or a project-specific phpcs.xml.dist file.

Enterprise Documentation

SymPress uses the global SymPress/.github repository for organization-wide contributing, security, code of conduct, issue, and pull request defaults. This package adds local docs only where the coding standard needs package-specific policy.

Development

Run the package coding standard:

Run PHPUnit:

Run PHPUnit with coverage reports when Xdebug or PCOV is available:

Run the full QA script:

Copyright and License

This package is distributed under GPL-2.0-or-later. It contains modified GPL-licensed work from the Syde PHP Coding Standards project. See LICENSE.


All versions of coding-standards with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
automattic/vipwpcs Version ^3.0
dealerdirect/phpcodesniffer-composer-installer Version ^1.0
phpcompatibility/php-compatibility Version ^9.3 || ^10.0@alpha
phpcsstandards/phpcsextra Version ^1.2
phpcsstandards/phpcsutils Version ^1.0
sirbrillig/phpcs-variable-analysis Version ^2.11
slevomat/coding-standard Version ^8.15
squizlabs/php_codesniffer Version ^3.13.5
wp-coding-standards/wpcs Version ^3.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sympress/coding-standards contains the following files

Loading the files please wait ...