diff --git a/php/psalm.xml b/php/psalm.xml index d75b961eb..47ad1a129 100644 --- a/php/psalm.xml +++ b/php/psalm.xml @@ -2,8 +2,8 @@ subItems[$ruleType->name] ?? []; /** diff --git a/php/src/GherkinParser.php b/php/src/GherkinParser.php index adbdb06a5..3fdeb410e 100644 --- a/php/src/GherkinParser.php +++ b/php/src/GherkinParser.php @@ -18,6 +18,8 @@ /** * Parses a Gherkin document (or list of Source envelopes) and emits Cucumber Messages envelopes + * + * @psalm-api */ final class GherkinParser { @@ -28,13 +30,13 @@ final class GherkinParser * @param bool $predictableIds Ignored if IdGenerator is provided */ public function __construct( - private readonly bool $predictableIds = false, + bool $predictableIds = false, private readonly bool $includeSource = true, private readonly bool $includeGherkinDocument = true, private readonly bool $includePickles = true, ?IdGenerator $idGenerator = null, ) { - $this->idGenerator = $idGenerator ?? ($this->predictableIds ? new IncrementingIdGenerator() : new UuidIdGenerator()); + $this->idGenerator = $idGenerator ?? ($predictableIds ? new IncrementingIdGenerator() : new UuidIdGenerator()); $this->pickleCompiler = new PickleCompiler($this->idGenerator); } diff --git a/php/src/Location.php b/php/src/Location.php index 7f7a8fd15..5c5454dc7 100644 --- a/php/src/Location.php +++ b/php/src/Location.php @@ -4,6 +4,9 @@ namespace Cucumber\Gherkin; +/** + * @psalm-api + */ final class Location { public function __construct( diff --git a/php/src/Parser/ParserTrait.php b/php/src/Parser/ParserTrait.php index d386ae506..23e83e526 100644 --- a/php/src/Parser/ParserTrait.php +++ b/php/src/Parser/ParserTrait.php @@ -72,12 +72,10 @@ private function addError(ParserContext $context, ParserException $error): void /** * @template U * @param callable() : U $action - * - * @return U */ - private function handleAstError(ParserContext $context, callable $action): mixed + private function handleAstError(ParserContext $context, callable $action): void { - return $this->handleExternalError($context, $action, null); + $this->handleExternalError($context, $action, null); } /**