diff --git a/src/Symfony/Component/Form/Resources/translations/validators.hr.xlf b/src/Symfony/Component/Form/Resources/translations/validators.hr.xlf index 8d0bd29201..a04ab1283f 100644 --- a/src/Symfony/Component/Form/Resources/translations/validators.hr.xlf +++ b/src/Symfony/Component/Form/Resources/translations/validators.hr.xlf @@ -14,6 +14,126 @@ The CSRF token is invalid. Please try to resubmit the form. CSRF vrijednost nije ispravna. Pokušajte ponovo poslati obrazac. + + This value is not a valid HTML5 color. + Ova vrijednost nije ispravna HTML5 boja. + + + Please enter a valid birthdate. + Molim upišite ispravan datum rođenja. + + + The selected choice is invalid. + Odabrani izbor nije ispravan. + + + The collection is invalid. + Kolekcija nije ispravna. + + + Please select a valid color. + Molim odaberite ispravnu boju. + + + Please select a valid country. + Molim odaberite ispravnu državu. + + + Please select a valid currency. + Molim odaberite ispravnu valutu. + + + Please choose a valid date interval. + Molim odaberite ispravni vremenski interval. + + + Please enter a valid date and time. + Molim unesite ispravni datum i vrijeme. + + + Please enter a valid date. + Molim odaberite ispravan datum. + + + Please select a valid file. + Molim odaberite ispravnu datoteku. + + + The hidden field is invalid. + Skriveno polje nije ispravno. + + + Please enter an integer. + Molim unesite cijeli broj. + + + Please select a valid language. + Molim odaberite ispravan jezik. + + + Please select a valid locale. + Molim odaberite ispravnu lokalizaciju. + + + Please enter a valid money amount. + Molim unesite ispravan iznos novca. + + + Please enter a number. + Molim unesite broj. + + + The password is invalid. + Ova lozinka nije ispravna. + + + Please enter a percentage value. + Molim unesite vrijednost postotka. + + + The values do not match. + Ove vrijednosti se ne poklapaju. + + + Please enter a valid time. + Molim unesite ispravno vrijeme. + + + Please select a valid timezone. + Molim odaberite ispravnu vremensku zonu. + + + Please enter a valid URL. + Molim unesite ispravan URL. + + + Please enter a valid search term. + Molim unesite ispravan pojam za pretraživanje. + + + Please provide a valid phone number. + Molim navedite ispravan telefonski broj. + + + The checkbox has an invalid value. + Polje za potvrdu sadrži neispravnu vrijednost. + + + Please enter a valid email address. + Molim unesite valjanu adresu elektronske pošte. + + + Please select a valid option. + Molim odaberite ispravnu opciju. + + + Please select a valid range. + Molim odaberite ispravan raspon. + + + Please enter a valid week. + Molim unesite ispravni tjedan. + diff --git a/src/Symfony/Component/HttpFoundation/JsonResponse.php b/src/Symfony/Component/HttpFoundation/JsonResponse.php index cf15c59a58..3967ff5db5 100644 --- a/src/Symfony/Component/HttpFoundation/JsonResponse.php +++ b/src/Symfony/Component/HttpFoundation/JsonResponse.php @@ -43,6 +43,10 @@ class JsonResponse extends Response { parent::__construct('', $status, $headers); + if ($json && !\is_string($data) && !is_numeric($data) && !\is_callable([$data, '__toString'])) { + throw new \TypeError(sprintf('"%s": If $json is set to true, argument $data must be a string or object implementing __toString(), "%s" given.', __METHOD__, get_debug_type($data))); + } + if (null === $data) { $data = new \ArrayObject(); } @@ -81,13 +85,13 @@ class JsonResponse extends Response * return JsonResponse::fromJsonString('{"key": "value"}') * ->setSharedMaxAge(300); * - * @param string|null $data The JSON response string - * @param int $status The response status code - * @param array $headers An array of response headers + * @param string $data The JSON response string + * @param int $status The response status code + * @param array $headers An array of response headers * * @return static */ - public static function fromJsonString(string $data = null, int $status = 200, array $headers = []) + public static function fromJsonString(string $data, int $status = 200, array $headers = []) { return new static($data, $status, $headers, true); } diff --git a/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php index 702f4c7bea..c0bbd83029 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php @@ -267,6 +267,36 @@ class JsonResponseTest extends TestCase $this->assertEquals('/**/ಠ_ಠ["foo"].bar[0]({"foo":"bar"});', $response->getContent()); } + + public function testConstructorWithNullAsDataThrowsAnUnexpectedValueException() + { + $this->expectException(\TypeError::class); + $this->expectExceptionMessage('If $json is set to true, argument $data must be a string or object implementing __toString(), "null" given.'); + + new JsonResponse(null, 200, [], true); + } + + public function testConstructorWithObjectWithToStringMethod() + { + $class = new class() { + public function __toString() + { + return '{}'; + } + }; + + $response = new JsonResponse($class, 200, [], true); + + $this->assertSame('{}', $response->getContent()); + } + + public function testConstructorWithObjectWithoutToStringMethodThrowsAnException() + { + $this->expectException(\TypeError::class); + $this->expectExceptionMessage('If $json is set to true, argument $data must be a string or object implementing __toString(), "stdClass" given.'); + + new JsonResponse(new \stdClass(), 200, [], true); + } } if (interface_exists('JsonSerializable', false)) { diff --git a/src/Symfony/Component/Messenger/Bridge/Beanstalkd/.gitattributes b/src/Symfony/Component/Messenger/Bridge/Beanstalkd/.gitattributes index ebb9287043..84c7add058 100644 --- a/src/Symfony/Component/Messenger/Bridge/Beanstalkd/.gitattributes +++ b/src/Symfony/Component/Messenger/Bridge/Beanstalkd/.gitattributes @@ -1,3 +1,4 @@ /Tests export-ignore /phpunit.xml.dist export-ignore +/.gitattributes export-ignore /.gitignore export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Discord/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Discord/.gitattributes index ebb9287043..84c7add058 100644 --- a/src/Symfony/Component/Notifier/Bridge/Discord/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Discord/.gitattributes @@ -1,3 +1,4 @@ /Tests export-ignore /phpunit.xml.dist export-ignore +/.gitattributes export-ignore /.gitignore export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Discord/DiscordTransport.php b/src/Symfony/Component/Notifier/Bridge/Discord/DiscordTransport.php index 41723f6712..ebe881397d 100644 --- a/src/Symfony/Component/Notifier/Bridge/Discord/DiscordTransport.php +++ b/src/Symfony/Component/Notifier/Bridge/Discord/DiscordTransport.php @@ -68,7 +68,7 @@ final class DiscordTransport extends AbstractTransport $content = $message->getSubject(); if (\strlen($content) > 2000) { - throw new LogicException(sprintf('The subject length of "%s" transport must be less than 2000 characters.', __CLASS__, ChatMessage::class, get_debug_type($message))); + throw new LogicException(sprintf('The subject length of "%s" transport must be less than 2000 characters.', __CLASS__)); } $endpoint = sprintf('https://%s/api/webhooks/%s/%s', $this->getEndpoint(), $this->webhookId, $this->token); diff --git a/src/Symfony/Component/Notifier/Bridge/GoogleChat/.gitattributes b/src/Symfony/Component/Notifier/Bridge/GoogleChat/.gitattributes index ebb9287043..84c7add058 100644 --- a/src/Symfony/Component/Notifier/Bridge/GoogleChat/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/GoogleChat/.gitattributes @@ -1,3 +1,4 @@ /Tests export-ignore /phpunit.xml.dist export-ignore +/.gitattributes export-ignore /.gitignore export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Infobip/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Infobip/.gitattributes index ebb9287043..84c7add058 100644 --- a/src/Symfony/Component/Notifier/Bridge/Infobip/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Infobip/.gitattributes @@ -1,3 +1,4 @@ /Tests export-ignore /phpunit.xml.dist export-ignore +/.gitattributes export-ignore /.gitignore export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/LinkedIn/LinkedInTransport.php b/src/Symfony/Component/Notifier/Bridge/LinkedIn/LinkedInTransport.php index 48ba8536c1..ae078b25e6 100644 --- a/src/Symfony/Component/Notifier/Bridge/LinkedIn/LinkedInTransport.php +++ b/src/Symfony/Component/Notifier/Bridge/LinkedIn/LinkedInTransport.php @@ -97,17 +97,17 @@ final class LinkedInTransport extends AbstractTransport { return [ 'specificContent' => [ - 'com.linkedin.ugc.ShareContent' => [ - 'shareCommentary' => [ - 'attributes' => [], - 'text' => $message->getSubject(), - ], - 'shareMediaCategory' => 'NONE', - ], + 'com.linkedin.ugc.ShareContent' => [ + 'shareCommentary' => [ + 'attributes' => [], + 'text' => $message->getSubject(), ], - 'visibility' => [ - 'com.linkedin.ugc.MemberNetworkVisibility' => 'PUBLIC', + 'shareMediaCategory' => 'NONE', ], + ], + 'visibility' => [ + 'com.linkedin.ugc.MemberNetworkVisibility' => 'PUBLIC', + ], 'lifecycleState' => 'PUBLISHED', 'author' => sprintf('urn:li:person:%s', $this->accountId), ]; diff --git a/src/Symfony/Component/Notifier/Bridge/Mobyt/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Mobyt/.gitattributes index ebb9287043..84c7add058 100644 --- a/src/Symfony/Component/Notifier/Bridge/Mobyt/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Mobyt/.gitattributes @@ -1,3 +1,4 @@ /Tests export-ignore /phpunit.xml.dist export-ignore +/.gitattributes export-ignore /.gitignore export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Smsapi/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Smsapi/.gitattributes index ebb9287043..84c7add058 100644 --- a/src/Symfony/Component/Notifier/Bridge/Smsapi/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Smsapi/.gitattributes @@ -1,3 +1,4 @@ /Tests export-ignore /phpunit.xml.dist export-ignore +/.gitattributes export-ignore /.gitignore export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Zulip/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Zulip/.gitattributes index ebb9287043..84c7add058 100644 --- a/src/Symfony/Component/Notifier/Bridge/Zulip/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Zulip/.gitattributes @@ -1,3 +1,4 @@ /Tests export-ignore /phpunit.xml.dist export-ignore +/.gitattributes export-ignore /.gitignore export-ignore diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.hr.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.hr.xlf index 411a48572a..e193dcb500 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.hr.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.hr.xlf @@ -62,6 +62,14 @@ Account is locked. Račun je zaključan. + + Too many failed login attempts, please try again later. + Previše neuspjelih pokušaja prijave, molim pokušajte ponovo kasnije. + + + Invalid or expired login link. + Link za prijavu je isteako ili je neispravan. + diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.pt.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.pt.xlf index b1a4af5154..286dab2665 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.pt.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.pt.xlf @@ -62,6 +62,14 @@ Account is locked. A conta está trancada. + + Too many failed login attempts, please try again later. + Várias tentativas de login falhadas, por favor tente mais tarde. + + + Invalid or expired login link. + Ligação de login inválida ou expirada. + diff --git a/src/Symfony/Component/Semaphore/.gitattributes b/src/Symfony/Component/Semaphore/.gitattributes index 15f635e92c..84c7add058 100644 --- a/src/Symfony/Component/Semaphore/.gitattributes +++ b/src/Symfony/Component/Semaphore/.gitattributes @@ -1,3 +1,4 @@ -/.gitignore export-ignore -/phpunit.xml.dist export-ignore /Tests export-ignore +/phpunit.xml.dist export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf index ccc0c0135a..2d8cf7dbb9 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf @@ -362,6 +362,30 @@ This password has been leaked in a data breach, it must not be used. Please use another password. Ova lozinka je procurila u nekom od sigurnosnih propusta, te je potrebno koristiti drugu lozinku. + + This value should be between {{ min }} and {{ max }}. + Ova vrijednost treba biti između {{ min }} i {{ max }}. + + + This value is not a valid hostname. + Ova vrijednost nije ispravno ime poslužitelja (engl. hostname). + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Broj elemenata u kolekciji treba biti djeljiv s {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Ova vrijednost mora zadovoljiti jedan od sljedećih ograničenja: + + + Each element of this collection should satisfy its own set of constraints. + Svaki element ove kolekcije mora zadovoljiti vlastiti skup ograničenja. + + + This value is not a valid International Securities Identification Number (ISIN). + Ova vrijednost nije ispravan međunarodni identifikacijski broj vrijednosnih papira (ISIN). + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf index 0244ee4f39..71bdaf8bc1 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf @@ -330,6 +330,62 @@ This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. O Código de Identificação de Empresa (BIC) não está associado ao IBAN {{ iban }}. + + This value should be valid JSON. + Este valor deve ser um JSON válido. + + + This collection should contain only unique elements. + Esta coleção deve conter só elementos únicos. + + + This value should be positive. + Este valor deve ser estritamente positivo. + + + This value should be either positive or zero. + Este valor deve ser superior ou igual a zero. + + + This value should be negative. + Este valor deve ser estritamente negativo. + + + This value should be either negative or zero. + Este valor deve ser inferior ou igual a zero. + + + This value is not a valid timezone. + Este valor não é um fuso horário válido. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Esta senha foi divulgada durante uma fuga de dados, não deve ser usada de novamente. Por favor usar uma senha outra. + + + This value should be between {{ min }} and {{ max }}. + Este valor deve situar-se entre {{ min }} e {{ max }}. + + + This value is not a valid hostname. + Este valor não é um nome de host válido. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + O número de elementos desta coleção deve ser um múltiplo de {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Este valor deve satisfazer pelo menos uma das seguintes restrições : + + + Each element of this collection should satisfy its own set of constraints. + Cada elemento desta coleção deve satisfazer o seu próprio conjunto de restrições. + + + This value is not a valid International Securities Identification Number (ISIN). + Este valor não é um Número Internacional de Identificação de Segurança (ISIN) válido. +