Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using PHP-CS for better development #126

Open
mrcnpdlk opened this issue Apr 6, 2021 · 1 comment
Open

Using PHP-CS for better development #126

mrcnpdlk opened this issue Apr 6, 2021 · 1 comment
Labels

Comments

@mrcnpdlk
Copy link
Contributor

mrcnpdlk commented Apr 6, 2021

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

@skipperbent
Copy link
Owner

Nice project, I didn't know about CS-fixer. I see it often in simple-router when people add patches, some don't even use PSR2. What a great find 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants