Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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",
Expand Down
1 change: 1 addition & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<rule ref="Drupal"/>
<!-- Checks that the strict_types has been declared. -->
<rule ref="Generic.PHP.RequireStrictTypes" />
<rule ref="DrevOps"/>

<!-- Show sniff codes in all reports -->
<arg value="s"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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);
};

Expand Down