diff --git a/.github/workflows/phpcompatibility.yml b/.github/workflows/phpcompatibility.yml new file mode 100644 index 0000000..fdd6982 --- /dev/null +++ b/.github/workflows/phpcompatibility.yml @@ -0,0 +1,9 @@ +name: PHPCompatibility +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: 7.0-8-0 + run: docker run --rm -v $PWD:/code domw/phpcompatibility:8.0-cli phpcs --standard=PHPCompatibility --runtime-set testVersion 7.0-8.0 --colors --warning-severity=0 --report=full,summary --extensions=php,phtml ./ diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml new file mode 100644 index 0000000..1f5b829 --- /dev/null +++ b/.github/workflows/phpcs.yml @@ -0,0 +1,10 @@ +name: M2 Coding Standard +on: [push, pull_request] + +jobs: + static: + name: M2 Coding Standard + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: extdn/github-actions-m2/magento-coding-standard@master \ No newline at end of file diff --git a/.github/workflows/phpcsfixer.yml b/.github/workflows/phpcsfixer.yml new file mode 100644 index 0000000..e283088 --- /dev/null +++ b/.github/workflows/phpcsfixer.yml @@ -0,0 +1,9 @@ +name: php-cs-fixer +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: PHP CS Fixer + run: docker run --rm -v $PWD:/code domw/php-cs-fixer php-cs-fixer fix --dry-run --diff --stop-on-violation --allow-risky=yes ./ \ No newline at end of file diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 0000000..ac4f518 --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,12 @@ +name: M2 PHPStan +on: [push, pull_request] + +jobs: + phpstan: + name: M2 PHPStan + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: extdn/github-actions-m2/magento-phpstan@master + with: + composer_name: reviewscouk/reviews \ No newline at end of file diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..4645891 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,43 @@ +in('Block') + ->in('Controller') + ->in('Helper') + ->in('Model') + ->in('Observer') + ->in('view') + ->name('*.phtml'); + +$config = new PhpCsFixer\Config(); +$config->setFinder($finder) + ->setRules([ + '@PSR2' => true, + 'array_syntax' => ['syntax' => 'short'], + 'concat_space' => ['spacing' => 'one'], + 'include' => true, + 'new_with_braces' => true, + 'no_empty_statement' => true, + 'no_extra_blank_lines' => true, + 'no_leading_import_slash' => true, + 'no_leading_namespace_whitespace' => true, + 'no_multiline_whitespace_around_double_arrow' => true, + 'multiline_whitespace_before_semicolons' => true, + 'no_singleline_whitespace_before_semicolons' => true, + 'no_trailing_comma_in_singleline_array' => true, + 'no_unused_imports' => true, + 'no_whitespace_in_blank_line' => true, + 'object_operator_without_whitespace' => true, + 'ordered_imports' => true, + 'standardize_not_equals' => true, + 'ternary_operator_spaces' => true, + ]); +return $config; \ No newline at end of file