facile-it / php-openid-client

PHP OpenID Client
35 stars 7 forks source link

Proposal - Use drupol/php-conventions package #5

Closed drupol closed 3 years ago

drupol commented 3 years ago

Hello,

Just like you, I also publish PHP libraries and Symfony bundles. Over the years, the need for a clean code has arisen.

Then, I created a package: drupol/php-conventions.

It's based on Grumphp and provides a default configuration for it.

In this context, Grumphp is configured to execute multiple tasks. Those tasks can be executed seamlessly on local or on CI, with the same syntax.

Example:

To run the code style: ./vendor/bin/grumphp run --testsuite=cs Output:

$ ./vendor/bin/grumphp run --testsuite=cs
GrumPHP is sniffing your code!

 ! [NOTE] Running testsuite: cs                                                                                         

Running tasks with priority 0!
==============================

Running task 1/7: composer... ✔
Running task 2/7: composer_normalize... ✔
Running task 3/7: yamllint... ✔
Running task 4/7: phplint... ✔
Running task 5/7: twigcs...
Running task 6/7: phpcsfixer... ✔
Running task 7/7: phpcs... ✔
             ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
           ▄▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌
         ▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌
        ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌
        ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌
  ▄▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌
 ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌
 ▐█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌
   ▀█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌
     ▀▀▓▓▓▓▓▓▓▓▓▓▓▓█▀▀▀▀▀▀▀▀▀▀▀▀▀▀████████████▄
      ▄████████▀▀▀▀▀                 ██████████
     ███████▀                         ██████▀
      ▐████      ██▌          ██       ████▌
        ▐█▌                            ███
         █▌           ▄▄ ▄▄           ▐███
        ███       ▄▄▄▄▄▄▄▄▄▄▄▄       ▐███
         ██▄ ▐███████████████████████████
        █▀█████████▌▀▀▀▀▀▀▀▀▀██████████▌▐
          ███████████▄▄▄▄▄▄▄███████████▌
         ▐█████████████████████████████
          █████████████████████████████
           ██ █████████████████████▐██▀
            ▀ ▐███████████████████▌ ▐▀
                ████▀████████▀▐███
                 ▀█▌  ▐█████  ▐█▌
                        ██▀   ▐▀
       _    _ _                         _ _
      / \  | | |   __ _  ___   ___   __| | |
     / _ \ | | |  / _` |/ _ \ / _ \ / _` | |
    / ___ \| | | | (_| | (_) | (_) | (_| |_|
   /_/   \_\_|_|  \__, |\___/ \___/ \__,_(_)
                  |___/

To run the code static analysis : ./vendor/bin/grumphp run --testsuite=static-analysis

You can find an example of use of this package on those projects: ecphp/cas-lib, ecphp/cas-bundle, loophp/collection, gravataLonga/container... There are projects of mine and contrib projects who adopted this package.

Grumphp comes with PHP-CS-Fixer and PHPCS tasks enabled and working together without conflicts. In order to do that, I've spent quite a lot of time adjusting the PHP-CS-Fixer rules (I created a package just for that). Those php-cs-fixer rules are based on PSR2, PSR12 and Symfony rules and some custom adjustments.

This PR is a proposal to use this package as a dependency.

Let me know what you think of the idea.

thomasvargiu commented 3 years ago

Hi @drupol, honestly I don't know if this PR will be merged.

For Code Style, we already have this package for our organization and I'll implement it.

I need time to take a look on this PR.

drupol commented 3 years ago

It's just a proposal, feel free to use it or not, it's the same for me, I'm not offended at all in any case!

thomasvargiu commented 3 years ago

Closed for #16