Skip to content

Add array return type to BaseContext::getTranslationResources()#41

Merged
Jean-Beru merged 1 commit into
soyuka:mainfrom
Shine-neko:fix/behat-4-return-type
May 15, 2026
Merged

Add array return type to BaseContext::getTranslationResources()#41
Jean-Beru merged 1 commit into
soyuka:mainfrom
Shine-neko:fix/behat-4-return-type

Conversation

@Shine-neko

Copy link
Copy Markdown

Behat 4 enforces : array on TranslatableContext::getTranslationResources().

Without this, soyuka/contexts is incompatible with Behat 4 due to the parent interface having a stricter signature than the child.
The method body is unchanged — glob() already returns an array on this path.

Behat 3 stays supported: the 3.x interface has no return type, and PHP covariance allows a child to add one, so this is not a BC break.

Encountered while migrating a Symfony 7 → 8 project that depends on Behat 4.x.

Comment thread src/Context/BaseContext.php
Behat 4 enforces ': array' on TranslatableContext::getTranslationResources().
Without this, soyuka/contexts is incompatible with Behat 4 due to the parent
having a stricter signature than the child.

The method body is unchanged - glob() already returns an array on this path.
Behat 3 stays supported: the 3.x interface has no return type, and PHP
covariance allows a child to add one, so this is not a BC break.
@Shine-neko Shine-neko force-pushed the fix/behat-4-return-type branch from 3838f3b to 26db129 Compare May 15, 2026 11:40
@Jean-Beru

Copy link
Copy Markdown
Collaborator

Thanks @Shine-neko !

@Jean-Beru Jean-Beru merged commit 687cb94 into soyuka:main May 15, 2026
8 of 11 checks passed
@Shine-neko Shine-neko deleted the fix/behat-4-return-type branch May 15, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants