symplify/coding-standard

Set of Symplify rules for PHP_CodeSniffer and PHP CS Fixer.

Installs: 2 250 348

Dependents: 29

Suggesters: 2

Security: 0

Stars: 252

Watchers: 11

Forks: 10

8.3.48 2020-10-26 10:38 UTC

This package is auto-updated.

Last update: 2020-10-31 10:40:10 UTC


README

Downloads

Set of rules for PHP_CodeSniffer, PHP-CS-Fixer and PHPStan used by Symplify projects.

They run best with EasyCodingStandard and PHPStan.

Install

composer require symplify/coding-standard --dev
composer require symplify/easy-coding-standard --dev
  1. Run with ECS:
vendor/bin/ecs process src --set symplify

or even better

# ecs.php
 <?php

 declare(strict_types=1);

 use Symplify\EasyCodingStandard\ValueObject\Option;
+use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

 return static function (ContainerConfigurator $containerConfigurator): void {
     $parameters = $containerConfigurator->parameters();

+    $parameters->set(Option::SETS, [
+        SetList::SYMPLIFY,
+    ]);
 };
  1. Register rules for PHPStan:
# phpstan.neon
includes:
    - vendor/symplify/coding-standard/config/symplify-rules.neon

Rules Overview


Contribute

The sources of this package are contained in the symplify monorepo. We welcome contributions for this package at symplify/symplify.