Skip to content

Implement a tool to automatically fix PHP Coding Standards issues  #10

@vitormattos

Description

@vitormattos

Context:

In PHP it is not mandatory to use coding standards (spaces, brace placement, etc). To define coding standards in the language, the PSRs were created.

Tasks:

  • Implement of friendsofphp/php-cs-fixer package and apply standard definition.
  • Implement script in composer.json to run the check and fix. Example:
     "scripts": {
         "post-install-cmd": [
             "composer install -d tests/tools/php-cs-fixer/"
         ],
         "post-update-cmd": [
             "composer install -d tests/tools/php-cs-fixer/"
         ],
         "cs:check": "tests/tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --diff",
         "cs:fix": "tests/tools/php-cs-fixer/vendor/bin/php-cs-fixer fix"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions