description

1.4.7 2022-04-22 14:07 UTC

This package is auto-updated.

Last update: 2024-04-22 18:54:56 UTC


README

Usage

  • $ composer require anatolygerasimov/code --dev
  • $ composer require psalm/plugin-laravel
  • add folder configuration for composer.json
    "extra": {
      "code": {
        "rector": {
          "paths": [
            "/app/Containers/AppSection"
          ],
          "skip": [
            "/app/Ship/Migrations/*",
            "/app/Ship/Core/*",
            "/app/Containers/*/Data/Migrations/*",
            "/app/Containers/*/Data/Criterias/*",
            "/app/Containers/*/Routes/*"
          ]
        },
        "cs-fixer": {
          "paths": [
            "/app/Containers",
            "/config",
            "/database"
          ],
          "skip": [
            "/bootstrap",
            "/resources",
            "/node_modules",
            "/public",
            "/storage",
            "/vendor"        
          ]
        },
        "psalm": {
          "paths": [
            "/app/Containers"
          ],
          "skip": [
            "/vendor"
          ],
          "config": {
            "plugins": {
              "pluginClass": [
                {"class": "Psalm\\LaravelPlugin\\Plugin"}
              ]
            }
          }
        }
      }
    }
  • composer.json
    "scripts": {
      "rector": [
        "./vendor/bin/rector process --config=./vendor/anatolygerasimov/code/configs/rector.php  --clear-cache"
      ],
      "rector-check": [
        "./vendor/bin/rector process --config=./vendor/anatolygerasimov/code/configs/rector.php  --clear-cache --dry-run"
      ],
      "php-cs-fixer": [
        "./vendor/bin/php-cs-fixer fix --config=./vendor/anatolygerasimov/code/configs/.php_cs.dist.php --allow-risky=yes --using-cache=no"
      ],
      "php-cs-fixer-check": [
        "./vendor/bin/php-cs-fixer fix --dry-run --config=./vendor/anatolygerasimov/code/configs/.php_cs.dist.php --diff -vv --allow-risky=yes --using-cache=no"
      ],
      "psalm": [
        "php ./vendor/anatolygerasimov/code/src/psalm_config.php --target=./psalm.xml",
        "./vendor/bin/psalm --threads=4 --no-cache --config=./psalm.xml",
        "rm ./psalm.xml"
      ]
    }

TODO:

  • runner for this tools