github Behat/Gherkin v4.15.0

13 hours ago

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 resultant FeatureNode::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 GherkinCompatibilityMode to control how gherkin files are parsed. In the default legacy mode, there is no change to parsing. In the new experimental gherkin-32 mode, 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
    • \n literals in table cells will be parsed as newlines by @stof in #359 and #391
  • Improved translations for ru (Russian) and af (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/gherkin version is unknown by @uuf6429 in #370

Internal

Don't miss a new Gherkin release

NewReleases is sending notifications on new releases.