Skip to content

Using PHP-CS for better development #126

@mrcnpdlk

Description

@mrcnpdlk

I suggest adding PHPCS for better code structure maintenance by many programmers.
https://github.com/FriendsOfPHP/PHP-CS-Fixer
Personally, I use the configuration below

        return [
            // default
            '@PSR2'                      => true,
            '@Symfony'                   => true,
            // additionally
            'array_syntax'               => ['syntax' => 'short'],
            'concat_space'               => false,
            'cast_spaces'                => false,
            'no_unused_imports'          => false,
            'no_useless_else'            => true,
            'no_useless_return'          => true,
            'no_superfluous_phpdoc_tags' => false,
            'ordered_imports'            => true,
            'phpdoc_align'               => true,
            'phpdoc_order'               => true,
            'phpdoc_trim'                => true,
            'phpdoc_summary'             => false,
            'simplified_null_return'     => false,
            'ternary_to_null_coalescing' => true,
            'binary_operator_spaces'     => ['default' => 'align'],
        ];

Before each commit run script: composer fixer

I able to prepare the patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions