diff --git a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php index 530f88d4b5..f71efd750a 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php @@ -541,7 +541,7 @@ class YamlFileLoader extends FileLoader throw new InvalidArgumentException(sprintf('Invalid method call for service "%s", did you forgot a leading dash before "%s: ..." in "%s"?', $id, $k, $file)); } - if (isset($call['method'])) { + if (isset($call['method']) && \is_string($call['method'])) { $method = $call['method']; $args = $call['arguments'] ?? []; $returnsClone = $call['returns_clone'] ?? false; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/alt_call.yaml b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/alt_call.yaml index 26cf9e628c..fb7f3440de 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/alt_call.yaml +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/alt_call.yaml @@ -3,3 +3,5 @@ services: calls: - foo: [1, 2, 3] - bar: !returns_clone [1, 2, 3] + - method: + - url diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php index 5c2b29559e..ecb7ac13b0 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php @@ -958,6 +958,7 @@ class YamlFileLoaderTest extends TestCase $expected = [ ['foo', [1, 2, 3]], ['bar', [1, 2, 3], true], + ['method', ['url']], ]; $this->assertSame($expected, $container->getDefinition('foo')->getMethodCalls()); diff --git a/src/Symfony/Component/Form/Resources/translations/validators.be.xlf b/src/Symfony/Component/Form/Resources/translations/validators.be.xlf index 004ba594b3..0513ca1dc9 100644 --- a/src/Symfony/Component/Form/Resources/translations/validators.be.xlf +++ b/src/Symfony/Component/Form/Resources/translations/validators.be.xlf @@ -14,6 +14,126 @@ The CSRF token is invalid. Please try to resubmit the form. CSRF-токен не сапраўдны. Калі ласка, паспрабуйце яшчэ раз адправіць форму. + + This value is not a valid HTML5 color. + Значэнне не з'яўляецца карэктным HTML5 колерам. + + + Please enter a valid birthdate. + Калі ласка, увядзіце карэктную дату нараджэння. + + + The selected choice is invalid. + Выбраны варыянт некарэктны. + + + The collection is invalid. + Калекцыя некарэктна. + + + Please select a valid color. + Калі ласка, выберыце карэктны колер. + + + Please select a valid country. + Калі ласка, выберыце карэктную краіну. + + + Please select a valid currency. + Калі ласка, выберыце карэктную валюту. + + + Please choose a valid date interval. + Калі ласка, выберыце карэктны інтэрвал дат. + + + Please enter a valid date and time. + Калі ласка, увядзіце карэктныя дату і час. + + + Please enter a valid date. + Калі ласка, увядзіце карэктную дату. + + + Please select a valid file. + Калі ласка, выберыце карэктны файл. + + + The hidden field is invalid. + Значэнне схаванага поля некарэктна. + + + Please enter an integer. + Калі ласка, увядзіце цэлы лік. + + + Please select a valid language. + Калі ласка, выберыце карэктную мову. + + + Please select a valid locale. + Калі ласка, выберыце карэктную лакаль. + + + Please enter a valid money amount. + Калі ласка, увядзіце карэктную колькасць грошай. + + + Please enter a number. + Калі ласка, увядзіце нумар. + + + The password is invalid. + Няправільны пароль. + + + Please enter a percentage value. + Калі ласка, увядзіце працэнтнае значэнне. + + + The values do not match. + Значэнні не супадаюць. + + + Please enter a valid time. + Калі ласка, увядзіце карэктны час. + + + Please select a valid timezone. + Калі ласка, выберыце карэктны гадзінны пояс. + + + Please enter a valid URL. + Калі ласка, увядзіце карэктны URL. + + + Please enter a valid search term. + Калі ласка, увядзіце карэктны пошукавы запыт. + + + Please provide a valid phone number. + Калі ласка, увядзіце карэктны нумар тэлефона. + + + The checkbox has an invalid value. + Флажок мае некарэктнае значэнне. + + + Please enter a valid email address. + Калі ласка, увядзіце карэктны адрас электроннай пошты. + + + Please select a valid option. + Калі ласка, выберыце карэктны варыянт. + + + Please select a valid range. + Калі ласка, выберыце карэктны дыяпазон. + + + Please enter a valid week. + Калі ласка, увядзіце карэктны тыдзень. + diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.be.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.be.xlf index c3cd7911e5..b24a5c421a 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.be.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.be.xlf @@ -62,6 +62,14 @@ Account is locked. Акаўнт заблакіраван. + + Too many failed login attempts, please try again later. + Зашмат няўдалых спроб уваходу, калі ласка, паспрабуйце пазней. + + + Invalid or expired login link. + Спасылка для ўваходу несапраўдная або пратэрмінаваная. + diff --git a/src/Symfony/Component/Security/Core/User/User.php b/src/Symfony/Component/Security/Core/User/User.php index 5429baa0cd..fa5cfb524e 100644 --- a/src/Symfony/Component/Security/Core/User/User.php +++ b/src/Symfony/Component/Security/Core/User/User.php @@ -83,7 +83,14 @@ final class User implements UserInterface, EquatableInterface } /** - * {@inheritdoc} + * Checks whether the user's account has expired. + * + * Internally, if this method returns false, the authentication system + * will throw an AccountExpiredException and prevent login. + * + * @return bool true if the user's account is non expired, false otherwise + * + * @see AccountExpiredException */ public function isAccountNonExpired(): bool { @@ -91,7 +98,14 @@ final class User implements UserInterface, EquatableInterface } /** - * {@inheritdoc} + * Checks whether the user is locked. + * + * Internally, if this method returns false, the authentication system + * will throw a LockedException and prevent login. + * + * @return bool true if the user is not locked, false otherwise + * + * @see LockedException */ public function isAccountNonLocked(): bool { @@ -99,7 +113,14 @@ final class User implements UserInterface, EquatableInterface } /** - * {@inheritdoc} + * Checks whether the user's credentials (password) has expired. + * + * Internally, if this method returns false, the authentication system + * will throw a CredentialsExpiredException and prevent login. + * + * @return bool true if the user's credentials are non expired, false otherwise + * + * @see CredentialsExpiredException */ public function isCredentialsNonExpired(): bool { @@ -107,7 +128,14 @@ final class User implements UserInterface, EquatableInterface } /** - * {@inheritdoc} + * Checks whether the user is enabled. + * + * Internally, if this method returns false, the authentication system + * will throw a DisabledException and prevent login. + * + * @return bool true if the user is enabled, false otherwise + * + * @see DisabledException */ public function isEnabled(): bool { diff --git a/src/Symfony/Component/Translation/Extractor/PhpExtractor.php b/src/Symfony/Component/Translation/Extractor/PhpExtractor.php index fcb33f05a6..c5efb5f3b5 100644 --- a/src/Symfony/Component/Translation/Extractor/PhpExtractor.php +++ b/src/Symfony/Component/Translation/Extractor/PhpExtractor.php @@ -236,6 +236,19 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface } break; case \T_END_HEREDOC: + if ($indentation = strspn($t[1], ' ')) { + $docPartWithLineBreaks = $docPart; + $docPart = ''; + + foreach (preg_split('~(\r\n|\n|\r)~', $docPartWithLineBreaks, -1, \PREG_SPLIT_DELIM_CAPTURE) as $str) { + if (\in_array($str, ["\r\n", "\n", "\r"], true)) { + $docPart .= $str; + } else { + $docPart .= substr($str, $indentation); + } + } + } + $message .= PhpStringTokenParser::parseDocString($docToken, $docPart); $docToken = ''; $docPart = ''; diff --git a/src/Symfony/Component/Translation/Tests/Extractor/PhpExtractorTest.php b/src/Symfony/Component/Translation/Tests/Extractor/PhpExtractorTest.php index 69b9758d16..82ddfe0e8a 100644 --- a/src/Symfony/Component/Translation/Tests/Extractor/PhpExtractorTest.php +++ b/src/Symfony/Component/Translation/Tests/Extractor/PhpExtractorTest.php @@ -130,6 +130,27 @@ EOF; $this->assertEquals(['sources' => [$filename.':37']], $catalogue->getMetadata('other-domain-test-no-params-short-array', 'not_messages')); } + /** + * @requires PHP 7.3 + */ + public function testExtractionFromIndentedHeredocNowdoc() + { + $catalogue = new MessageCatalogue('en'); + + $extractor = new PhpExtractor(); + $extractor->setPrefix('prefix'); + $extractor->extract(__DIR__.'/../fixtures/extractor-7.3/translation.html.php', $catalogue); + + $expectedCatalogue = [ + 'messages' => [ + "heredoc\nindented\n further" => "prefixheredoc\nindented\n further", + "nowdoc\nindented\n further" => "prefixnowdoc\nindented\n further", + ], + ]; + + $this->assertEquals($expectedCatalogue, $catalogue->all()); + } + public function resourcesProvider() { $directory = __DIR__.'/../fixtures/extractor/'; diff --git a/src/Symfony/Component/Translation/Tests/fixtures/extractor-7.3/translation.html.php b/src/Symfony/Component/Translation/Tests/fixtures/extractor-7.3/translation.html.php new file mode 100644 index 0000000000..35ffe8812e --- /dev/null +++ b/src/Symfony/Component/Translation/Tests/fixtures/extractor-7.3/translation.html.php @@ -0,0 +1,13 @@ +This template is used for translation message extraction tests +trans(<< +trans(<<<'EOF' + nowdoc + indented + further + EOF +); ?> diff --git a/src/Symfony/Component/Validator/Constraint.php b/src/Symfony/Component/Validator/Constraint.php index f5311c242f..4a9af65ef7 100644 --- a/src/Symfony/Component/Validator/Constraint.php +++ b/src/Symfony/Component/Validator/Constraint.php @@ -25,7 +25,7 @@ use Symfony\Component\Validator\Exception\MissingOptionsException; * * Constraint instances are immutable and serializable. * - * @property array $groups The groups that the constraint belongs to + * @property string[] $groups The groups that the constraint belongs to * * @author Bernhard Schussek */ @@ -263,7 +263,7 @@ abstract class Constraint * * Override this method if you want to define required options. * - * @return array + * @return string[] * * @see __construct() */ @@ -293,7 +293,7 @@ abstract class Constraint * This method should return one or more of the constants * Constraint::CLASS_CONSTRAINT and Constraint::PROPERTY_CONSTRAINT. * - * @return string|array One or more constant values + * @return string|string[] One or more constant values */ public function getTargets() { diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.be.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.be.xlf index ab3845ee20..5f9988ef3c 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.be.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.be.xlf @@ -362,6 +362,30 @@ This password has been leaked in a data breach, it must not be used. Please use another password. Гэты пароль быў выкрадзены ў выніку ўзлому дадзеных, таму яго нельга выкарыстоўваць. Калі ласка, выкарыстоўвайце іншы пароль. + + This value should be between {{ min }} and {{ max }}. + Значэнне павінна быць паміж {{min}} і {{max}}. + + + This value is not a valid hostname. + Значэнне не з'яўляецца карэктным імем хаста. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Колькасць элементаў у гэтай калекцыі павінна быць кратным {{compared_value}}. + + + This value should satisfy at least one of the following constraints: + Значэнне павінна задавальняць як мінімум аднаму з наступных абмежаванняў: + + + Each element of this collection should satisfy its own set of constraints. + Кожны элемент гэтай калекцыі павінен задавальняць свайму ўласнаму набору абмежаванняў. + + + This value is not a valid International Securities Identification Number (ISIN). + Значэнне не з'яўляецца карэктным міжнародным ідэнтыфікацыйным нумарам каштоўных папер (ISIN). +