Fix MinkContext::getTranslationResources() return type; update checkout action
Behat 4 added ': array' to TranslatableContext::getTranslationResources(), causing a fatal "must be compatible" error. Add the return type to both getTranslationResources() and getMinkTranslationResources(); also guard glob() with ?: [] since it can return false when no files match. Update actions/checkout to v5 (Node 24 compatible) — v4 breaks on GitHub Actions after June 16 2026. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2
.github/workflows/test.yaml
vendored
2
.github/workflows/test.yaml
vendored
@@ -41,7 +41,7 @@ jobs:
|
|||||||
symfony-version: '8.1.*'
|
symfony-version: '8.1.*'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
|
|||||||
@@ -298,20 +298,14 @@ class MinkContext extends RawMinkContext implements TranslatableContext
|
|||||||
system(sprintf($this->getMinkParameter('show_cmd'), escapeshellarg($filename)));
|
system(sprintf($this->getMinkParameter('show_cmd'), escapeshellarg($filename)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public static function getTranslationResources(): array
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public static function getTranslationResources()
|
|
||||||
{
|
{
|
||||||
return self::getMinkTranslationResources();
|
return self::getMinkTranslationResources();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public static function getMinkTranslationResources(): array
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public static function getMinkTranslationResources()
|
|
||||||
{
|
{
|
||||||
return glob(__DIR__.'/../../../../i18n/*.xliff');
|
return glob(__DIR__.'/../../../../i18n/*.xliff') ?: [];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function fixStepArgument($argument)
|
protected function fixStepArgument($argument)
|
||||||
|
|||||||
Reference in New Issue
Block a user