Skip to content

Commit

Permalink
re-added symfony 5.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
wickedOne committed Nov 16, 2023
1 parent 1b8fc9f commit a883965
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 20 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ symfony phrase translation provider bridge
[![license](http://poser.pugx.org/wickedone/phrase-translation-provider/license)](https://packagist.org/packages/wickedone/phrase-translation-provider)
[![php](http://poser.pugx.org/wickedone/phrase-translation-provider/require/php)](https://packagist.org/packages/wickedone/phrase-translation-provider)

> :warning: this translation provider [has been integrated](https://github.com/symfony/phrase-translation-provider) into symfony starting at version 6.4.
> this repository will be archived once [lts expires](https://symfony.com/releases/5.4) for symfony 5.4
## installation

```bash
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"psr/cache": "^3.0",
"psr/event-dispatcher": "^1.0",
"symfony/event-dispatcher-contracts": "^3.4.0",
"symfony/http-client": "6.3.8",
"symfony/mime": "6.3.5",
"symfony/translation": "6.3.7"
"symfony/http-client": "^5.4 || ^6.0",
"symfony/mime": "^5.4 || ^6.0",
"symfony/translation": "^5.4 || ^6.0"
},
"require-dev": {
"infection/infection": "^0.27.8",
Expand Down
3 changes: 2 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>wickedOne/.github:renovate-config"
]
],
"rangeStrategy": "widen"
}
2 changes: 1 addition & 1 deletion tests/Config/ReadConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function testFallbackLocaleDisabled(): void
$this->assertFalse($config->isFallbackLocaleEnabled());
}

public function dsnOptionsProvider(): \Generator
public static function dsnOptionsProvider(): \Generator
{
yield 'default options' => [
'dsn' => 'phrase://PROJECT_ID:API_TOKEN@default?userAgent=myProject',
Expand Down
2 changes: 1 addition & 1 deletion tests/Config/WriteConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function testWithTagAndLocale(): void
$this->assertSame($expectedOptions, $config->getOptions());
}

public function dsnOptionsProvider(): \Generator
public static function dsnOptionsProvider(): \Generator
{
yield 'default options' => [
'dsn' => 'phrase://PROJECT_ID:API_TOKEN@default?userAgent=myProject',
Expand Down
28 changes: 14 additions & 14 deletions tests/PhraseProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public function testTranslatorBagAssert(): void
$provider->write($trans);
}

public function cacheKeyProvider(): \Generator
public static function cacheKeyProvider(): \Generator
{
yield 'sortorder one' => [
'options' => [
Expand Down Expand Up @@ -878,7 +878,7 @@ public function testWriteProviderExceptions(int $statusCode, string $expectedExc
$provider->write($bag);
}

public function writeProvider(): \Generator
public static function writeProvider(): \Generator
{
$expectedEnglishXliff = <<<'XLIFF'
<?xml version="1.0" encoding="utf-8"?>
Expand Down Expand Up @@ -999,9 +999,9 @@ public function toStringProvider(): \Generator
/**
* @return array<string, ExceptionDefinition>
*/
public function deleteExceptionsProvider(): array
public static function deleteExceptionsProvider(): array
{
return $this->getExceptionResponses(
return self::getExceptionResponses(
exceptionMessage: 'Unable to delete key in phrase.',
loggerMessage: 'Unable to delete key "key.to.delete" in phrase: "provider error".',
statusCode: 500
Expand All @@ -1011,9 +1011,9 @@ public function deleteExceptionsProvider(): array
/**
* @return array<string, ExceptionDefinition>
*/
public function writeExceptionsProvider(): array
public static function writeExceptionsProvider(): array
{
return $this->getExceptionResponses(
return self::getExceptionResponses(
exceptionMessage: 'Unable to upload translations to phrase.',
loggerMessage: 'Unable to upload translations for domain "messages" to phrase: "provider error".'
);
Expand All @@ -1022,9 +1022,9 @@ public function writeExceptionsProvider(): array
/**
* @return array<string, ExceptionDefinition>
*/
public function createLocalesExceptionsProvider(): array
public static function createLocalesExceptionsProvider(): array
{
return $this->getExceptionResponses(
return self::getExceptionResponses(
exceptionMessage: 'Unable to create locale phrase.',
loggerMessage: 'Unable to create locale "nl-NL" in phrase: "provider error".'
);
Expand All @@ -1033,9 +1033,9 @@ public function createLocalesExceptionsProvider(): array
/**
* @return array<string, ExceptionDefinition>
*/
public function initLocalesExceptionsProvider(): array
public static function initLocalesExceptionsProvider(): array
{
return $this->getExceptionResponses(
return self::getExceptionResponses(
exceptionMessage: 'Unable to get locales from phrase.',
loggerMessage: 'Unable to get locales from phrase: "provider error".'
);
Expand All @@ -1044,15 +1044,15 @@ public function initLocalesExceptionsProvider(): array
/**
* @return array<string, ExceptionDefinition>
*/
public function readProviderExceptionsProvider(): array
public static function readProviderExceptionsProvider(): array
{
return $this->getExceptionResponses(
return self::getExceptionResponses(
exceptionMessage: 'Unable to get translations from phrase.',
loggerMessage: 'Unable to get translations for locale "en_GB" from phrase: "provider error".'
);
}

public function readProvider(): \Generator
public static function readProvider(): \Generator
{
$bag = new TranslatorBag();
$catalogue = new MessageCatalogue('en_GB', [
Expand Down Expand Up @@ -1154,7 +1154,7 @@ public function readProvider(): \Generator
/**
* @return array<string, ExceptionDefinition>
*/
private function getExceptionResponses(string $exceptionMessage, string $loggerMessage, int $statusCode = 400): array
private static function getExceptionResponses(string $exceptionMessage, string $loggerMessage, int $statusCode = 400): array
{
return [
'bad request' => [
Expand Down

0 comments on commit a883965

Please sign in to comment.