diff --git a/.github/workflows/test-php.yml b/.github/workflows/test-php.yml index cc137d2..f115372 100644 --- a/.github/workflows/test-php.yml +++ b/.github/workflows/test-php.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Cache Composer dependencies uses: actions/cache@v4 diff --git a/composer.json b/composer.json index 53a973d..e1b90f0 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,8 @@ "rector/rector": "^2", "squizlabs/php_codesniffer": "^3", "symfony/process": "^6 || ^7.0", - "drupal/coder": "^8.3" + "drupal/coder": "^8.3", + "drevops/phpcs-standard": "^0.6" }, "autoload": { "psr-0": { @@ -46,10 +47,10 @@ "lint": [ "phpcs", "phpstan", - "rector --clear-cache --dry-run" + "rector --dry-run" ], "lint-fix": [ - "rector --clear-cache", + "rector", "phpcbf" ], "reset": "rm -Rf vendor vendor-bin composer.lock", diff --git a/phpcs.xml b/phpcs.xml index df8192d..ad7215e 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -6,6 +6,7 @@ + diff --git a/src/DrevOps/BehatFormatProgressFail/Printer/PrinterProgressFail.php b/src/DrevOps/BehatFormatProgressFail/Printer/PrinterProgressFail.php index 5bf88d7..c60a06e 100644 --- a/src/DrevOps/BehatFormatProgressFail/Printer/PrinterProgressFail.php +++ b/src/DrevOps/BehatFormatProgressFail/Printer/PrinterProgressFail.php @@ -4,6 +4,7 @@ namespace DrevOps\BehatFormatProgressFail\Printer; +use Behat\Gherkin\Node\ArgumentInterface; use Behat\Behat\Definition\Call\DefinitionCall; use Behat\Behat\Output\Node\Printer\Helper\ResultToStringConverter; use Behat\Behat\Output\Node\Printer\StepPrinter; @@ -83,17 +84,17 @@ protected function printFailure(StepResult $result, StepNode $step): string { $feature = $call->getFeature(); $file_name = $this->relativizePaths($feature->getFile() ?? ''); } - $fileLine = $step->getLine(); + $file_line = $step->getLine(); $output .= PHP_EOL; $output .= sprintf('{+%s}--- FAIL ---{-%s}', $style, $style); $output .= PHP_EOL; - $output .= sprintf(sprintf(' {+%s}%%s %%s{-%s} {+comment}# (%%s):%%s{-comment}', $style, $style), $step->getKeyword(), $step->getText(), $file_name, $fileLine); + $output .= sprintf(sprintf(' {+%s}%%s %%s{-%s} {+comment}# (%%s):%%s{-comment}', $style, $style), $step->getKeyword(), $step->getText(), $file_name, $file_line); $output .= PHP_EOL; $step_arguments = $step->getArguments(); - $step_arguments = array_map(static function ($item) { + $step_arguments = array_map(static function (ArgumentInterface $item) { if (method_exists($item, '__toString')) { return $item->__toString(); } @@ -138,7 +139,7 @@ protected function printStdOut(OutputPrinter $printer, StepResult $result): void } $printer->writeln("\n" . $step_definition->getPath() . ':'); - $pad = function ($line): string { + $pad = function (string $line): string { return sprintf(' | {+stdout}%s{-stdout}', $line); };