From 3fd07beb22fd99fcd57c55fe55eea6df49c2cd0a Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Sun, 11 Dec 2022 10:51:57 +0100 Subject: [PATCH 1/7] [Translator] Fix typo "internal" / "interval" --- Test/TranslatorTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Test/TranslatorTest.php b/Test/TranslatorTest.php index 98f0267..68587f1 100644 --- a/Test/TranslatorTest.php +++ b/Test/TranslatorTest.php @@ -140,7 +140,7 @@ public function getTransChoiceTests() } /** - * @dataProvider getInternal + * @dataProvider getInterval */ public function testInterval($expected, $number, $interval) { @@ -149,7 +149,7 @@ public function testInterval($expected, $number, $interval) $this->assertEquals($expected, $translator->trans($interval.' foo|[1,Inf[ bar', ['%count%' => $number])); } - public function getInternal() + public function getInterval() { return [ ['foo', 3, '{1,2, 3 ,4}'], From 5d486b95806b9b2b0e623b3e4a4358e0c92d95bf Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 1 Jan 2023 09:32:19 +0100 Subject: [PATCH 2/7] Bump license year to 2023 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 74cdc2d..99757d5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2022 Fabien Potencier +Copyright (c) 2018-2023 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 31722be10beef7c8c197f2586e16c0623e19eb3f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 24 Jan 2023 15:02:24 +0100 Subject: [PATCH 3/7] Update license years (last time) --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 99757d5..7536cae 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2023 Fabien Potencier +Copyright (c) 2018-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 73539c29f28f9889381bc4830044453f0fec7b2b Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Sun, 12 Feb 2023 23:57:18 +0100 Subject: [PATCH 4/7] Add void return types --- TranslatorTrait.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/TranslatorTrait.php b/TranslatorTrait.php index 46e9170..e3b0adf 100644 --- a/TranslatorTrait.php +++ b/TranslatorTrait.php @@ -22,6 +22,9 @@ trait TranslatorTrait { private ?string $locale = null; + /** + * @return void + */ public function setLocale(string $locale) { $this->locale = $locale; From 2d37db7c3786e9f684d1ca718f88ed7c821d0e53 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 14 Feb 2023 09:53:37 +0100 Subject: [PATCH 5/7] Fix merge --- Test/TranslatorTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Test/TranslatorTest.php b/Test/TranslatorTest.php index c5c37b3..e4168cc 100644 --- a/Test/TranslatorTest.php +++ b/Test/TranslatorTest.php @@ -114,7 +114,7 @@ public function testGetLocaleReturnsDefaultLocaleIfNotSet() $this->assertEquals('en', $translator->getLocale()); } - public function getTransTests() + public static function getTransTests() { return [ ['Symfony is great!', 'Symfony is great!', []], @@ -122,7 +122,7 @@ public function getTransTests() ]; } - public function getTransChoiceTests() + public static function getTransChoiceTests() { return [ ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], @@ -146,7 +146,7 @@ public function testInterval($expected, $number, $interval) $this->assertEquals($expected, $translator->trans($interval.' foo|[1,Inf[ bar', ['%count%' => $number])); } - public function getInterval() + public static function getInterval() { return [ ['foo', 3, '{1,2, 3 ,4}'], @@ -189,7 +189,7 @@ public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number) $translator->trans($id, ['%count%' => $number]); } - public function getNonMatchingMessages() + public static function getNonMatchingMessages() { return [ ['{0} There are no apples|{1} There is one apple', 2], @@ -199,7 +199,7 @@ public function getNonMatchingMessages() ]; } - public function getChooseTests() + public static function getChooseTests() { return [ ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], @@ -315,7 +315,7 @@ public function testLangcodes($nplural, $langCodes) * * As it is impossible to have this ever complete we should try as hard as possible to have it almost complete. */ - public function successLangcodes(): array + public static function successLangcodes(): array { return [ ['1', ['ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky']], @@ -334,7 +334,7 @@ public function successLangcodes(): array * * @return array with nplural together with langcodes */ - public function failingLangcodes(): array + public static function failingLangcodes(): array { return [ ['1', ['fa']], From 1f40e77fbb12a16d841688f42fecefd8ceb43ed6 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 16 Feb 2023 11:55:45 +0100 Subject: [PATCH 6/7] [Contracts] Add missing return types --- LocaleAwareInterface.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LocaleAwareInterface.php b/LocaleAwareInterface.php index 6923b97..db40ba1 100644 --- a/LocaleAwareInterface.php +++ b/LocaleAwareInterface.php @@ -16,6 +16,8 @@ interface LocaleAwareInterface /** * Sets the current locale. * + * @return void + * * @throws \InvalidArgumentException If the locale contains invalid characters */ public function setLocale(string $locale); From dfec258b9dd17a6b24420d464c43bffe347441c8 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 1 Mar 2023 11:32:47 +0100 Subject: [PATCH 7/7] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 42e5c51..b211d58 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Symfony Translation Contracts A set of abstractions extracted out of the Symfony components. -Can be used to build on semantics that the Symfony components proved useful - and +Can be used to build on semantics that the Symfony components proved useful and that already have battle tested implementations. See https://github.com/symfony/contracts/blob/main/README.md for more information.