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

Overview

Coding Standard

Downloads

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

They run best with EasyCodingStandard.

Install

composer require symplify/coding-standard --dev
composer require symplify/easy-coding-standard --dev
  1. Run with ECS:
# ecs.php
+use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

 return static function (ContainerConfigurator $containerConfigurator): void {
+    $containerConfigurator->import(SetList::SYMPLIFY);

Rules Overview


Contribute

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

You might also like...
Naive Bayes works by looking at a training set and making a guess based on that set.

Naive Bayes Naive Bayes works by looking at a training set and making a guess based on that set. It uses simple statistics and a bit of math to calcul

Composer installer for PHP_CodeSniffer coding standards

PHP_CodeSniffer Standards Composer Installer Plugin This composer installer plugin allows for easy installation of PHP_CodeSniffer coding standards (r

This composer installer plugin allows for easy installation of PHP_CodeSniffer coding standards

PHP_CodeSniffer Standards Composer Installer Plugin This composer installer plugin allows for easy installation of PHP_CodeSniffer coding standards (r

This package provides a set of factories to be used with containers using the PSR-11 standard for an easy Doctrine integration in a project

psr-container-doctrine: Doctrine Factories for PSR-11 Containers Doctrine factories for PSR-11 containers. This package provides a set of factories to

Open-source library used in Gigadrive projects with common PHP utilities

PHP Commons This library provides PHP utilities used in Gigadrive projects, provided for the open-source community. Functions are registered globally

Test and enforce architectural rules in your Laravel applications. Keep your app's architecture clean and consistent!
Test and enforce architectural rules in your Laravel applications. Keep your app's architecture clean and consistent!

Laravel Arkitect Laravel Arkitect lets you test and enforce your architectural rules in your Laravel applications, and it's a PHPArkitect wrapper for

Rules to detect game engines and other technologies based on Steam depot file lists

SteamDB File Detection Rule Sets This is a set of scripts that are used by SteamDB to make educated guesses about the engine(s) & technology used to b

Validated properties in PHP8.1 and above using attribute rules
Validated properties in PHP8.1 and above using attribute rules

PHP Validated Properties Add Rule attributes to your model properties to make sure they are valid. Why this package? When validating external data com

Rector upgrades rules for Doctrine
Rector upgrades rules for Doctrine

Rector Rules for Doctrine See available Doctrine rules Install This package is already part of rector/rector package, so it works out of the box.

Comments
  • Changing from 0.1.3 to 0.1.4 breaks code sniffer.

    Changing from 0.1.3 to 0.1.4 breaks code sniffer.

    After updating symplify/coding-standard version CS stopped working.

    MethodCommentReturnTagSniff was renamed to MethodReturnTypeSniff. When using custom ruleset, CS starts throwing error. Within one major version sniffs shouldn't be renamed as it causes bc break.

    opened by mzstic 1
  • PHP7 Sniffs

    PHP7 Sniffs

    Use return type when possible

    /**
     * @return int
     */
    public function getValue()
    {
    }
    

    =>

    public function getValue() : int
    {
    }
    

    Use args type when possible

    Same for args:

    /**
     * @param int $amount
     */
    public function count($amount)
    {
    }
    

    =>

    public function count(int $amount)
    {
    }
    

    Unite return type format

    // Class
    public function getValue() : int
    
    // Interface
    public function getValue() : int;
    

    Use strict_value when needed

    When somewhere is some arg/return type, make this required.

    <?php 
    
    declare (strict_types = 1);
    
    opened by TomasVotruba 1
  • Sniff tip: prefer multiline key-based arrays

    Sniff tip: prefer multiline key-based arrays

    No

    $array = [1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four'];
    

    Yes!

    $array = [
        1 => 'one',
        2 => 'two',
        3 => 'three',
        4 => 'four'
    ];
    
    opened by TomasVotruba 1
Owner
Easy Coding Standard, Static Site Generator, Package Builder utils on PHP 8.0 and Symfony 5.4
null
The Easiest way to start using PHP CS Fixer and PHP_CodeSniffer with 0-knowledge

The Easiest Way to Use Any Coding Standard Features Blazing fast Parallel run Use PHP_CodeSniffer || PHP-CS-Fixer - anything you like 2nd run under fe

null 1.1k Jan 6, 2023
A wrapper around symplify/config-transformer used to update recipes and using easy coding standard for generating readable config files.

Symfony Recipes Yaml to PHP Converter This is a wrapper around the symplify/config-transformer used to convert Symfony core recipes which uses .yaml c

Alexander Schranz 3 Nov 24, 2022
ExtDN PHP_CodeSniffer rules for Magento 2

ExtDN PHP_CodeSniffer rules for Magento 2 Introduction There are already many PHP CodeSniffer rules out there to aid in Magento 2 development: Magento

ExtDN 81 Dec 16, 2022
php-cs-fixer config for Yakamara projects

php-cs-fixer config for Yakamara projects Installation composer require --dev yakamara/php-cs-fixer-config Example .php-cs-fixer.dist.php: <?php $fi

Yakamara Media GmbH & Co. KG 4 Nov 29, 2022
PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.

PHP_CodeSniffer is a set of two PHP scripts; the main phpcs script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second phpcbf script to automatically correct coding standard violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.

Squiz Labs 9.9k Jan 5, 2023
Provides a configuration factory and multiple rule sets for friendsofphp/php-cs-fixer.

php-cs-fixer-config Provides a configuration factory and multiple rule sets for friendsofphp/php-cs-fixer. Installation Run $ composer require --dev e

null 37 Jan 2, 2023
php-cs-fixer config for REDAXO

php-cs-fixer config for REDAXO Installation composer require --dev redaxo/php-cs-fixer-config Example .php-cs-fixer.dist.php: <?php $finder = (new P

REDAXO CMS c/o Yakamara Media GmbH & Co. KG 7 Aug 14, 2022
🙈 Code style configuration for `php-cs-fixer` based on PSR-12.

php-code-style Code style configuration for friendsofphp/php-cs-fixer based on PSR-12. Installation Step 1 of 3 Install gomzyakov/php-code-style via c

Alexander Gomzyakov 5 Nov 27, 2022
Laravel Pint is an opinionated PHP code style fixer for minimalists.

Laravel Pint is an opinionated PHP code style fixer for minimalists. Pint is built on top of PHP-CS-Fixer and makes it simple to ensure that your code style stays clean and consistent.

The Laravel Framework 2.2k Jan 5, 2023
Check modules in app/code and vendor for PHP 8 compatibility status - PHP_CodeSniffer & php-compatibility standard

M2 PHP version compatibility check How To use Requires PHP 7.3+ | PHP 8 This app will run PHP_CodeSniffer with phpcompatibility/php-compatibility on t

William Tran 24 Oct 13, 2022