Changed
- Added a new ParserInterface and deprecated extending the core Lexer, Parser and Node classes by @acoulton in #354
- Deprecate the CucumberNDJsonAstLoader (which was only intended for internal use by our tests) by @stof in #356
- By default, the parser ignores invalid language tags (e.g.
#language:no-such) and falls back to the default language (e.g.en). Previously, the resultantFeatureNode::getLanguage()would return the original invalid value from the feature file - it will now return the language that was actually used for parsing. By @stof in #350
Added
- Introduce a DialectProviderInterface matching the modern cucumber API. This will replace the existing Keywords API in a future major release. By @stof in #350
- Introduce configurable
GherkinCompatibilityModeto control how gherkin files are parsed. In the defaultlegacymode, there is no change to parsing. In the new experimentalgherkin-32mode, files will in future be parsed consistently with the official cucumber/gherkin parsers. This mode is not yet complete - in this first release:- Whitespace within description nodes will not be trimmed by @acoulton in #349
- Invalid language tags will cause an exception by @stof in #357
- Step keywords will not be trimmed by @stof in #360
- Language tags can include whitespace by @acoulton in #358
\nliterals in table cells will be parsed as newlines by @stof in #359 and #391
- Improved translations for
ru(Russian) andaf(Afrikaans) from cucumber/gherkin in #381 and #386 - Support PHP 8.5 by @acoulton in #388
Fixed
- Improve phpdoc / phpstan type-hinting of the lexer and parser by @uuf6429 in #344 and @stof in #363
- Handle race conditions when creating cache directory by @uuf6429 in #373
- Throw if Loader->load() called with unsupported resource by @uuf6429 in #372
- Use default file cache key if
behat/gherkinversion is unknown by @uuf6429 in #370
Internal
- Enable PHPStan level 10 and resolve remaining warnings by @uuf6429 in #368
- Remove duplication and improve robustness in filesystem operations by @uuf6429 in #365 and #367
- Explicitly cover expected departures from cucumber gherkin parsing with tests by @acoulton in #392
- Update cucumber/gherkin parity tests to v36.0.0 in #355, #376 #378, #381, #385, #386 and #387
- Fixes and improvements to the cucumber update CI job by @acoulton in #374,
#375, #379 and #380 - Minor coding style fixes by @acoulton in #377 and #383
- Minor code improvements to Lexer/Parser implementation by @uuf6429 in #352
- Minor code improvements to TableNode by @uuf6429 in #366
- Add native typehints where this does not break BC by @stof in #353
- Fix typo of a PHPStan alias type by @uuf6429 in #371
- Fix github actions workflow job name by @uuf6429 in #369