Skip to content

Commit

Permalink
Merge pull request #292 from acoulton/merge-up-4.12
Browse files Browse the repository at this point in the history
Merge 4.12.0 release to master
  • Loading branch information
acoulton authored Feb 26, 2025
2 parents 5edc2f5 + 44ea936 commit 47ee3db
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
This project follows the [Behat release and version support policies]
(https://docs.behat.org/en/latest/releases.html).

# [4.12.0] - 2025-02-26

### Changed
* Gherkin::VERSION is deprecated and will not be updated, use the composer runtime API if you need to identify the
running version. This also changes the value used to namespace cached feature files.
by @acoulton in [#279](https://github.com/Behat/Gherkin/pull/279)

### Added

* Provide `CachedArrayKeywords::withDefaultKeywords()` to create an instance without an external dependency on the path
to the `i18n.php` file in this repo. **NOTE** that paths to source files will change in the next Gherkin release -
use the new constructor to avoid any impact.
by @carlos-granados in [#290](https://github.com/Behat/Gherkin/pull/290)

### Internal

* Upgrade to phpunit 10 by @uuf6429 in [#275](https://github.com/Behat/Gherkin/pull/275)
* Remove redundant files by @uuf6429 in [#278](https://github.com/Behat/Gherkin/pull/278)
* Update documentation by @uuf6429 in [#274](https://github.com/Behat/Gherkin/pull/274)
* Adopt PHP CS Fixer and apply code styles by @uuf6429 in [#277](https://github.com/Behat/Gherkin/pull/277)
* Add PHPStan and improve / fix docblock annotations and type-safety within methods to achieve level 5 by
@uuf6429 in [#276](https://github.com/Behat/Gherkin/pull/276), [#281](https://github.com/Behat/Gherkin/pull/281),
[#282](https://github.com/Behat/Gherkin/pull/282), and [#287](https://github.com/Behat/Gherkin/pull/287)

# [4.11.0] - 2024-12-06

### Changed
Expand Down Expand Up @@ -420,4 +444,5 @@ This project follows the [Behat release and version support policies]
- 47 brand new translations (see i18n)
- Full test suite for everything from AST nodes to translations

[4.12.0]: https://github.com/Behat/Gherkin/compare/v4.11.0...v4.12.0
[4.11.0]: https://github.com/Behat/Gherkin/compare/v4.10.0...v4.11.0
7 changes: 6 additions & 1 deletion src/Keywords/CachedArrayKeywords.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@
*/
class CachedArrayKeywords extends ArrayKeywords
{
public static function withDefaultKeywords(): self
{
return new self(__DIR__ . '/../../i18n.php');
}

/**
* Initializes holder with file.
*
* @param string $file Cached array path
*/
public function __construct($file)
{
parent::__construct(include $file);
parent::__construct(require $file);
}
}
5 changes: 3 additions & 2 deletions tests/Keywords/CachedArrayKeywordsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ class CachedArrayKeywordsTest extends KeywordsTestCase
{
protected function getKeywords()
{
return new CachedArrayKeywords(__DIR__ . '/../../i18n.php');
// Test with the default i18n file provided in this repository
return CachedArrayKeywords::withDefaultKeywords();
}

protected function getKeywordsArray()
{
return include __DIR__ . '/../../i18n.php';
return require __DIR__ . '/../../i18n.php';
}

protected function getSteps($keywords, $text, &$line, $keywordType)
Expand Down

0 comments on commit 47ee3db

Please sign in to comment.