From 1689f77ef0bc50110d9d1f47b4b704166534c487 Mon Sep 17 00:00:00 2001 From: Roland Franssen Date: Tue, 13 Aug 2019 16:04:50 +0200 Subject: [PATCH 1/8] [Intl] Cleanup unused language aliases entry --- .../Component/Intl/Data/Generator/LanguageDataGenerator.php | 1 - src/Symfony/Component/Intl/Resources/data/languages/meta.json | 1 - 2 files changed, 2 deletions(-) diff --git a/src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php b/src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php index 7746b752d4..8e8c8752a4 100644 --- a/src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php +++ b/src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php @@ -158,7 +158,6 @@ class LanguageDataGenerator extends AbstractDataGenerator return [ 'Version' => $rootBundle['Version'], 'Languages' => $this->languageCodes, - 'Aliases' => array_column(iterator_to_array($metadataBundle['alias']['language']), 'replacement'), 'Alpha2ToAlpha3' => $this->generateAlpha2ToAlpha3Mapping($metadataBundle), ]; } diff --git a/src/Symfony/Component/Intl/Resources/data/languages/meta.json b/src/Symfony/Component/Intl/Resources/data/languages/meta.json index 7c03bf0c64..02ecee4bd5 100644 --- a/src/Symfony/Component/Intl/Resources/data/languages/meta.json +++ b/src/Symfony/Component/Intl/Resources/data/languages/meta.json @@ -622,7 +622,6 @@ "zxx", "zza" ], - "Aliases": [], "Alpha2ToAlpha3": { "aa": "aar", "ab": "abk", From e50d3bcf3186913eb69db49de196acef2be81415 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Tue, 13 Aug 2019 17:56:37 +0200 Subject: [PATCH 2/8] [TwigBridge] Replaced plain doc block copies with inheritdoc. --- src/Symfony/Bridge/Twig/Extension/RoutingExtension.php | 4 +--- .../Bridge/Twig/TokenParser/TransChoiceTokenParser.php | 10 ++-------- .../Twig/TokenParser/TransDefaultDomainTokenParser.php | 8 ++------ .../Bridge/Twig/TokenParser/TransTokenParser.php | 10 ++-------- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php b/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php index f380d13a57..936c2d9985 100644 --- a/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php @@ -33,9 +33,7 @@ class RoutingExtension extends AbstractExtension } /** - * Returns a list of functions to add to the existing list. - * - * @return array An array of functions + * {@inheritdoc} */ public function getFunctions() { diff --git a/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php b/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php index 7b673856f0..178dc1604a 100644 --- a/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php +++ b/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php @@ -27,11 +27,7 @@ use Twig\Token; class TransChoiceTokenParser extends TransTokenParser { /** - * Parses a token and returns a node. - * - * @return Node - * - * @throws SyntaxError + * {@inheritdoc} */ public function parse(Token $token) { @@ -82,9 +78,7 @@ class TransChoiceTokenParser extends TransTokenParser } /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name + * {@inheritdoc} */ public function getTag() { diff --git a/src/Symfony/Bridge/Twig/TokenParser/TransDefaultDomainTokenParser.php b/src/Symfony/Bridge/Twig/TokenParser/TransDefaultDomainTokenParser.php index ee546e05f0..45896f7b4a 100644 --- a/src/Symfony/Bridge/Twig/TokenParser/TransDefaultDomainTokenParser.php +++ b/src/Symfony/Bridge/Twig/TokenParser/TransDefaultDomainTokenParser.php @@ -24,9 +24,7 @@ use Twig\TokenParser\AbstractTokenParser; class TransDefaultDomainTokenParser extends AbstractTokenParser { /** - * Parses a token and returns a node. - * - * @return Node + * {@inheritdoc} */ public function parse(Token $token) { @@ -38,9 +36,7 @@ class TransDefaultDomainTokenParser extends AbstractTokenParser } /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name + * {@inheritdoc} */ public function getTag() { diff --git a/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php b/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php index ca2dae1618..819f63f79a 100644 --- a/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php +++ b/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php @@ -28,11 +28,7 @@ use Twig\TokenParser\AbstractTokenParser; class TransTokenParser extends AbstractTokenParser { /** - * Parses a token and returns a node. - * - * @return Node - * - * @throws SyntaxError + * {@inheritdoc} */ public function parse(Token $token) { @@ -83,9 +79,7 @@ class TransTokenParser extends AbstractTokenParser } /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name + * {@inheritdoc} */ public function getTag() { From 136972506e01aada553492a819eca9e01c420bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Tue, 13 Aug 2019 17:09:47 +0200 Subject: [PATCH 3/8] Fixed markdown file --- CHANGELOG-3.4.md | 2 +- CONTRIBUTORS.md | 2 +- UPGRADE-3.0.md | 2 +- src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md | 8 ++++---- .../FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md | 6 +++--- .../FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md | 2 +- .../Tests/Fixtures/Descriptor/route_collection_1.md | 8 ++++---- src/Symfony/Bundle/SecurityBundle/CHANGELOG.md | 2 +- src/Symfony/Bundle/WebServerBundle/CHANGELOG.md | 2 +- src/Symfony/Component/Console/CHANGELOG.md | 4 ++-- src/Symfony/Component/Ldap/README.md | 2 +- src/Symfony/Component/Serializer/CHANGELOG.md | 4 ++-- 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/CHANGELOG-3.4.md b/CHANGELOG-3.4.md index 904b246eac..c9ff275f81 100644 --- a/CHANGELOG-3.4.md +++ b/CHANGELOG-3.4.md @@ -257,7 +257,7 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c * bug #29355 [PropertyAccess] calculate cache keys for property setters depending on the value (xabbuh) * bug #29369 [DI] fix combinatorial explosion when analyzing the service graph (nicolas-grekas) * bug #29349 [Debug] workaround opcache bug mutating "$this" !?! (nicolas-grekas) - + * 3.4.19 (2018-11-26) * bug #29318 [Console] Move back root exception to stack trace in verbose mode (chalasr) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index a8b902b78b..30b6067d8e 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -760,7 +760,7 @@ Symfony is the result of the work of many people who made the code better - Thomas Ploch - Benjamin Grandfond (benjamin) - Tiago Brito (blackmx) - - + - - Richard van den Brand (ricbra) - develop - flip111 diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index f5cd6f57ea..98ea35b171 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -595,7 +595,7 @@ UPGRADE FROM 2.x to 3.0 } } ``` - + If the form is submitted with a different request method than `POST`, you need to configure this in the form: Before: diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index fcbe4ffa7f..f04942dbc0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -19,17 +19,17 @@ CHANGELOG * Deprecated the `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()` methods. * Deprecated `AddCacheClearerPass`, use tagged iterator arguments instead. * Deprecated `AddCacheWarmerPass`, use tagged iterator arguments instead. - * Deprecated `TranslationDumperPass`, use + * Deprecated `TranslationDumperPass`, use `Symfony\Component\Translation\DependencyInjection\TranslationDumperPass` instead - * Deprecated `TranslationExtractorPass`, use + * Deprecated `TranslationExtractorPass`, use `Symfony\Component\Translation\DependencyInjection\TranslationExtractorPass` instead - * Deprecated `TranslatorPass`, use + * Deprecated `TranslatorPass`, use `Symfony\Component\Translation\DependencyInjection\TranslatorPass` instead * Added `command` attribute to the `console.command` tag which takes the command name as value, using it makes the command lazy * Added `cache:pool:prune` command to allow manual stale cache item pruning of supported PSR-6 and PSR-16 cache pool implementations - * Deprecated `Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader`, use + * Deprecated `Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader`, use `Symfony\Component\Translation\Reader\TranslationReader` instead * Deprecated `translation.loader` service, use `translation.reader` instead * `AssetsInstallCommand::__construct()` now takes an instance of diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md index c36d35c83e..abe256e3dc 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md @@ -5,11 +5,11 @@ - Scheme: http|https - Method: GET|HEAD - Class: Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub -- Defaults: +- Defaults: - `name`: Joseph -- Requirements: +- Requirements: - `name`: [a-z]+ -- Options: +- Options: - `compiler_class`: Symfony\Component\Routing\RouteCompiler - `opt1`: val1 - `opt2`: val2 diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md index 1d776c5ffe..3ef2e87287 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md @@ -7,7 +7,7 @@ - Class: Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub - Defaults: NONE - Requirements: NO CUSTOM -- Options: +- Options: - `compiler_class`: Symfony\Component\Routing\RouteCompiler - `opt1`: val1 - `opt2`: val2 diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md index cbb70b4d31..29694b92a4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md @@ -8,11 +8,11 @@ route_1 - Scheme: http|https - Method: GET|HEAD - Class: Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub -- Defaults: +- Defaults: - `name`: Joseph -- Requirements: +- Requirements: - `name`: [a-z]+ -- Options: +- Options: - `compiler_class`: Symfony\Component\Routing\RouteCompiler - `opt1`: val1 - `opt2`: val2 @@ -30,7 +30,7 @@ route_2 - Class: Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub - Defaults: NONE - Requirements: NO CUSTOM -- Options: +- Options: - `compiler_class`: Symfony\Component\Routing\RouteCompiler - `opt1`: val1 - `opt2`: val2 diff --git a/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md b/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md index 357abd35ce..c88f85787a 100644 --- a/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md @@ -9,7 +9,7 @@ CHANGELOG * Tagging voters with the `security.voter` tag without implementing the `VoterInterface` on the class is now deprecated and will be removed in 4.0. * [BC BREAK] `FirewallContext::getListeners()` now returns `\Traversable|array` - * added info about called security listeners in profiler + * added info about called security listeners in profiler * Added `logout_on_user_change` to the firewall options. This config item will trigger a logout when the user has changed. Should be set to true to avoid deprecations in the configuration. diff --git a/src/Symfony/Bundle/WebServerBundle/CHANGELOG.md b/src/Symfony/Bundle/WebServerBundle/CHANGELOG.md index af709a0ee4..d576b69847 100644 --- a/src/Symfony/Bundle/WebServerBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/WebServerBundle/CHANGELOG.md @@ -4,7 +4,7 @@ CHANGELOG 3.4.0 ----- - * WebServer can now use '*' as a wildcard to bind to 0.0.0.0 (INADDR_ANY) + * WebServer can now use `*` as a wildcard to bind to 0.0.0.0 (INADDR_ANY) 3.3.0 ----- diff --git a/src/Symfony/Component/Console/CHANGELOG.md b/src/Symfony/Component/Console/CHANGELOG.md index 946ff1e0ba..6dba1a4ded 100644 --- a/src/Symfony/Component/Console/CHANGELOG.md +++ b/src/Symfony/Component/Console/CHANGELOG.md @@ -22,7 +22,7 @@ CHANGELOG with value optional explicitly passed empty * added console.error event to catch exceptions thrown by other listeners * deprecated console.exception event in favor of console.error -* added ability to handle `CommandNotFoundException` through the +* added ability to handle `CommandNotFoundException` through the `console.error` event * deprecated default validation in `SymfonyQuestionHelper::ask` @@ -38,7 +38,7 @@ CHANGELOG ----- * added truncate method to FormatterHelper - * added setColumnWidth(s) method to Table + * added setColumnWidth(s) method to Table 2.8.3 ----- diff --git a/src/Symfony/Component/Ldap/README.md b/src/Symfony/Component/Ldap/README.md index b79d60b095..dc10efc083 100644 --- a/src/Symfony/Component/Ldap/README.md +++ b/src/Symfony/Component/Ldap/README.md @@ -6,7 +6,7 @@ A Ldap client for PHP on top of PHP's ldap extension. Disclaimer ---------- -This component is only stable since Symfony 3.1. Earlier versions +This component is only stable since Symfony 3.1. Earlier versions have been marked as internal as they still needed some work. Breaking changes were introduced in Symfony 3.1, so code relying on previous version of the component will break with this version. diff --git a/src/Symfony/Component/Serializer/CHANGELOG.md b/src/Symfony/Component/Serializer/CHANGELOG.md index 450640d160..3b8b99f108 100644 --- a/src/Symfony/Component/Serializer/CHANGELOG.md +++ b/src/Symfony/Component/Serializer/CHANGELOG.md @@ -9,7 +9,7 @@ CHANGELOG * added support for serializing `DateInterval` objects * added getter for extra attributes in `ExtraAttributesException` * improved `CsvEncoder` to handle variable nested structures - * CSV headers can be passed to the `CsvEncoder` via the `csv_headers` serialization context variable + * CSV headers can be passed to the `CsvEncoder` via the `csv_headers` serialization context variable * added `$context` when checking for encoding, decoding and normalizing in `Serializer` 3.3.0 @@ -70,7 +70,7 @@ CHANGELOG * added `$context` support for XMLEncoder. * [DEPRECATION] JsonEncode and JsonDecode where modified to throw - an exception if error found. No need for get*Error() functions + an exception if error found. No need for `get*Error()` functions 2.3.0 ----- From 8e4d08fe952e4520b2bad1adb45aeda56e609edf Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 13 Aug 2019 22:09:12 +0200 Subject: [PATCH 4/8] [DI] fix docblocks in Container* --- .../Component/DependencyInjection/Container.php | 6 +++--- .../Component/DependencyInjection/ContainerBuilder.php | 10 +++++----- .../DependencyInjection/ContainerInterface.php | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Container.php b/src/Symfony/Component/DependencyInjection/Container.php index f2215acf1c..ab69579adb 100644 --- a/src/Symfony/Component/DependencyInjection/Container.php +++ b/src/Symfony/Component/DependencyInjection/Container.php @@ -162,8 +162,8 @@ class Container implements ResettableContainerInterface * Setting a synthetic service to null resets it: has() returns false and get() * behaves in the same way as if the service was never created. * - * @param string $id The service identifier - * @param object $service The service instance + * @param string $id The service identifier + * @param object|null $service The service instance */ public function set($id, $service) { @@ -263,7 +263,7 @@ class Container implements ResettableContainerInterface * @param string $id The service identifier * @param int $invalidBehavior The behavior when the service does not exist * - * @return object The associated service + * @return object|null The associated service * * @throws ServiceCircularReferenceException When a circular reference is detected * @throws ServiceNotFoundException When the service is not defined diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index 6676c33cab..a30d984e1f 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -519,8 +519,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface /** * Sets a service. * - * @param string $id The service identifier - * @param object $service The service instance + * @param string $id The service identifier + * @param object|null $service The service instance * * @throws BadMethodCallException When this ContainerBuilder is compiled */ @@ -571,7 +571,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface * @param string $id The service identifier * @param int $invalidBehavior The behavior when the service does not exist * - * @return object The associated service + * @return object|null The associated service * * @throws InvalidArgumentException when no definitions are available * @throws ServiceCircularReferenceException When a circular reference is detected @@ -1104,7 +1104,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface * @param string $id The service identifier * @param bool $tryProxy Whether to try proxying the service with a lazy proxy * - * @return object The service described by the service definition + * @return mixed The service described by the service definition * * @throws RuntimeException When the factory definition is incomplete * @throws RuntimeException When the service is a synthetic service @@ -1651,7 +1651,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface * Shares a given service in the container. * * @param Definition $definition - * @param object $service + * @param mixed $service * @param string|null $id */ private function shareService(Definition $definition, $service, $id, array &$inlineServices) diff --git a/src/Symfony/Component/DependencyInjection/ContainerInterface.php b/src/Symfony/Component/DependencyInjection/ContainerInterface.php index 2274ec7bb3..c5ab4c2eda 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerInterface.php +++ b/src/Symfony/Component/DependencyInjection/ContainerInterface.php @@ -32,8 +32,8 @@ interface ContainerInterface extends PsrContainerInterface /** * Sets a service. * - * @param string $id The service identifier - * @param object $service The service instance + * @param string $id The service identifier + * @param object|null $service The service instance */ public function set($id, $service); @@ -43,7 +43,7 @@ interface ContainerInterface extends PsrContainerInterface * @param string $id The service identifier * @param int $invalidBehavior The behavior when the service does not exist * - * @return object The associated service + * @return object|null The associated service * * @throws ServiceCircularReferenceException When a circular reference is detected * @throws ServiceNotFoundException When the service is not defined From f4c2ea5b7378d5d283c7e1bc1eea3676101cedad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Tue, 13 Aug 2019 19:24:27 +0200 Subject: [PATCH 5/8] Fix getMaxFilesize() returning zero --- .../Component/HttpFoundation/File/UploadedFile.php | 2 +- .../HttpFoundation/Tests/File/UploadedFileTest.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/File/UploadedFile.php b/src/Symfony/Component/HttpFoundation/File/UploadedFile.php index 093aaf8326..86153ed49c 100644 --- a/src/Symfony/Component/HttpFoundation/File/UploadedFile.php +++ b/src/Symfony/Component/HttpFoundation/File/UploadedFile.php @@ -217,7 +217,7 @@ class UploadedFile extends File $sizePostMax = self::parseFilesize(ini_get('post_max_size')); $sizeUploadMax = self::parseFilesize(ini_get('upload_max_filesize')); - return min([$sizePostMax, $sizeUploadMax]); + return min($sizePostMax ?: PHP_INT_MAX, $sizeUploadMax ?: PHP_INT_MAX); } /** diff --git a/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php b/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php index 629211052c..4186c72a62 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php @@ -281,4 +281,18 @@ class UploadedFileTest extends TestCase $this->assertFalse($file->isValid()); } + + public function testGetMaxFilesize() + { + $size = UploadedFile::getMaxFilesize(); + + $this->assertIsInt($size); + $this->assertGreaterThan(0, $size); + + if (0 === (int) ini_get('post_max_size') && 0 === (int) ini_get('upload_max_filesize')) { + $this->assertSame(PHP_INT_MAX, $size); + } else { + $this->assertLessThan(PHP_INT_MAX, $size); + } + } } From fbd4ce4c5c74347fe7657473c3246cd6a68fe332 Mon Sep 17 00:00:00 2001 From: Roland Franssen Date: Wed, 14 Aug 2019 08:36:48 +0200 Subject: [PATCH 6/8] [Intl] Explicit check --- .../Component/Intl/Data/Generator/LanguageDataGenerator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php b/src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php index 8e8c8752a4..73b15b6f1c 100644 --- a/src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php +++ b/src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php @@ -167,9 +167,9 @@ class LanguageDataGenerator extends AbstractDataGenerator $aliases = iterator_to_array($metadataBundle['alias']['language']); $alpha2ToAlpha3 = []; - foreach ($aliases as $alias => $language) { - $language = $language['replacement']; - if (2 === \strlen($language) && 3 === \strlen($alias)) { + foreach ($aliases as $alias => $data) { + $language = $data['replacement']; + if (2 === \strlen($language) && 3 === \strlen($alias) && 'overlong' === $data['reason']) { if (isset(self::$preferredAlpha2ToAlpha3Mapping[$language])) { // Validate to prevent typos if (!isset($aliases[self::$preferredAlpha2ToAlpha3Mapping[$language]])) { From 2aec7df12cd5783e7ef69b82acb17665cd431f83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Wed, 14 Aug 2019 10:40:35 +0200 Subject: [PATCH 7/8] Partially Revert "Remove trailing space in all markdown files" This reverts commit 5a3c19846e22399f5ce43d366346dd404e2f825f. --- .../FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md | 6 +++--- .../FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md | 2 +- .../Tests/Fixtures/Descriptor/route_collection_1.md | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md index abe256e3dc..c36d35c83e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md @@ -5,11 +5,11 @@ - Scheme: http|https - Method: GET|HEAD - Class: Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub -- Defaults: +- Defaults: - `name`: Joseph -- Requirements: +- Requirements: - `name`: [a-z]+ -- Options: +- Options: - `compiler_class`: Symfony\Component\Routing\RouteCompiler - `opt1`: val1 - `opt2`: val2 diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md index 3ef2e87287..1d776c5ffe 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md @@ -7,7 +7,7 @@ - Class: Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub - Defaults: NONE - Requirements: NO CUSTOM -- Options: +- Options: - `compiler_class`: Symfony\Component\Routing\RouteCompiler - `opt1`: val1 - `opt2`: val2 diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md index 29694b92a4..cbb70b4d31 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md @@ -8,11 +8,11 @@ route_1 - Scheme: http|https - Method: GET|HEAD - Class: Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub -- Defaults: +- Defaults: - `name`: Joseph -- Requirements: +- Requirements: - `name`: [a-z]+ -- Options: +- Options: - `compiler_class`: Symfony\Component\Routing\RouteCompiler - `opt1`: val1 - `opt2`: val2 @@ -30,7 +30,7 @@ route_2 - Class: Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub - Defaults: NONE - Requirements: NO CUSTOM -- Options: +- Options: - `compiler_class`: Symfony\Component\Routing\RouteCompiler - `opt1`: val1 - `opt2`: val2 From 644edb0e93ed06e1b9dc1d5957a042fad25af6c6 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 14 Aug 2019 11:39:58 +0200 Subject: [PATCH 8/8] cs fix --- phpunit | 3 +++ .../Finder/Tests/Iterator/IteratorTestCase.php | 13 +++---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/phpunit b/phpunit index b2883a1e05..46aec35a98 100755 --- a/phpunit +++ b/phpunit @@ -9,6 +9,9 @@ if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) { } if (!getenv('SYMFONY_PHPUNIT_VERSION')) { if (\PHP_VERSION_ID >= 70200) { + if (false === getenv('SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT') && false !== strpos(@file_get_contents(__DIR__.'/src/Symfony/Component/HttpKernel/Kernel.php'), 'const MAJOR_VERSION = 3;')) { + putenv('SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1'); + } putenv('SYMFONY_PHPUNIT_VERSION=8.3'); } elseif (\PHP_VERSION_ID >= 70000) { putenv('SYMFONY_PHPUNIT_VERSION=6.5'); diff --git a/src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php b/src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php index 796dc6ac36..c7dfd79e30 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php @@ -44,9 +44,8 @@ abstract class IteratorTestCase extends TestCase * $a and $b such that $a goes before $b in $expected, the method * asserts that any element of $a goes before any element of $b * in the sequence generated by $iterator - * @param \Traversable $iterator */ - protected function assertOrderedIteratorForGroups($expected, \Traversable $iterator) + protected function assertOrderedIteratorForGroups(array $expected, \Traversable $iterator) { $values = array_values(array_map(function (\SplFileInfo $fileinfo) { return $fileinfo->getPathname(); }, iterator_to_array($iterator))); @@ -63,11 +62,8 @@ abstract class IteratorTestCase extends TestCase /** * Same as IteratorTestCase::assertIterator with foreach usage. - * - * @param array $expected - * @param \Traversable $iterator */ - protected function assertIteratorInForeach($expected, \Traversable $iterator) + protected function assertIteratorInForeach(array $expected, \Traversable $iterator) { $values = []; foreach ($iterator as $file) { @@ -83,11 +79,8 @@ abstract class IteratorTestCase extends TestCase /** * Same as IteratorTestCase::assertOrderedIterator with foreach usage. - * - * @param array $expected - * @param \Traversable $iterator */ - protected function assertOrderedIteratorInForeach($expected, \Traversable $iterator) + protected function assertOrderedIteratorInForeach(array $expected, \Traversable $iterator) { $values = []; foreach ($iterator as $file) {