Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc9f35c

Browse files
committed
Merge branch '7.1' into 7.2
* 7.1: do not access typed property before initialization do not access typed properties before initialization Fix typo in deprecation message Symfony 5.4 LTS will get security fixes until Feb 2029 thanks to Ibexa' sponsoring Fix #53037
2 parents 814397d + 6c7f97f commit bc9f35c

File tree

11 files changed

+55
-22
lines changed

11 files changed

+55
-22
lines changed

src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function getKernel(): KernelInterface
5656
*/
5757
public function getProfile(): HttpProfile|false|null
5858
{
59-
if (null === $this->response || !$this->getContainer()->has('profiler')) {
59+
if (!isset($this->response) || !$this->getContainer()->has('profiler')) {
6060
return false;
6161
}
6262

src/Symfony/Bundle/FrameworkBundle/Tests/KernelBrowserTest.php

+8
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
1515
use Symfony\Bundle\FrameworkBundle\Tests\Functional\AbstractWebTestCase;
1616
use Symfony\Component\HttpFoundation\Response;
17+
use Symfony\Component\HttpKernel\KernelInterface;
1718

1819
class KernelBrowserTest extends AbstractWebTestCase
1920
{
@@ -61,6 +62,13 @@ public function testRequestAfterKernelShutdownAndPerformedRequest()
6162
$client->request('GET', '/');
6263
}
6364

65+
public function testGetProfileWithoutRequest()
66+
{
67+
$browser = new KernelBrowser($this->createMock(KernelInterface::class));
68+
69+
$this->assertFalse($browser->getProfile());
70+
}
71+
6472
private function getKernelMock()
6573
{
6674
$mock = $this->getMockBuilder($this->getKernelClass())

src/Symfony/Component/BrowserKit/AbstractBrowser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ public function reload(): Crawler
554554
*/
555555
public function followRedirect(): Crawler
556556
{
557-
if (!$this->redirect) {
557+
if (!isset($this->redirect)) {
558558
throw new LogicException('The request was not redirected.');
559559
}
560560

src/Symfony/Component/BrowserKit/Tests/AbstractBrowserTest.php

+11
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\BrowserKit\CookieJar;
1616
use Symfony\Component\BrowserKit\Exception\BadMethodCallException;
1717
use Symfony\Component\BrowserKit\Exception\InvalidArgumentException;
18+
use Symfony\Component\BrowserKit\Exception\LogicException;
1819
use Symfony\Component\BrowserKit\History;
1920
use Symfony\Component\BrowserKit\Request;
2021
use Symfony\Component\BrowserKit\Response;
@@ -889,4 +890,14 @@ public function testInternalRequestNull()
889890

890891
$client->getInternalRequest();
891892
}
893+
894+
public function testFollowRedirectWithoutRequest()
895+
{
896+
$browser = $this->getBrowser();
897+
898+
$this->expectException(LogicException::class);
899+
$this->expectExceptionMessage('The request was not redirected.');
900+
901+
$browser->followRedirect();
902+
}
892903
}

src/Symfony/Component/Emoji/EmojiTransliterator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ public function createInverse(): self
8585

8686
public function getErrorCode(): int|false
8787
{
88-
return $this->transliterator?->getErrorCode() ?? 0;
88+
return isset($this->transliterator) ? $this->transliterator->getErrorCode() : 0;
8989
}
9090

9191
public function getErrorMessage(): string|false
9292
{
93-
return $this->transliterator?->getErrorMessage() ?? false;
93+
return isset($this->transliterator) ? $this->transliterator->getErrorMessage() : false;
9494
}
9595

9696
public static function listIDs(): array

src/Symfony/Component/Emoji/Tests/EmojiTransliteratorTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,18 @@ public function testReverse()
194194
$this->expectException(\IntlException::class);
195195
EmojiTransliterator::create('emoji-en', EmojiTransliterator::REVERSE);
196196
}
197+
198+
public function testGetErrorCodeWithUninitializedTransliterator()
199+
{
200+
$transliterator = EmojiTransliterator::create('emoji-en');
201+
202+
$this->assertSame(0, $transliterator->getErrorCode());
203+
}
204+
205+
public function testGetErrorMessageWithUninitializedTransliterator()
206+
{
207+
$transliterator = EmojiTransliterator::create('emoji-en');
208+
209+
$this->assertFalse($transliterator->getErrorMessage());
210+
}
197211
}

src/Symfony/Component/HttpClient/NoPrivateNetworkHttpClient.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ public function stream(ResponseInterface|iterable $responses, ?float $timeout =
7474
}
7575

7676
/**
77-
* @deprecated since Symfony 7.1, configure the logger on the wrapper HTTP client directly instead
77+
* @deprecated since Symfony 7.1, configure the logger on the wrapped HTTP client directly instead
7878
*/
7979
public function setLogger(LoggerInterface $logger): void
8080
{
81-
trigger_deprecation('symfony/http-client', '7.1', 'Configure the logger on the wrapper HTTP client directly instead.');
81+
trigger_deprecation('symfony/http-client', '7.1', 'Configure the logger on the wrapped HTTP client directly instead.');
8282

8383
if ($this->client instanceof LoggerAwareInterface) {
8484
$this->client->setLogger($logger);

src/Symfony/Component/HttpClient/ScopingHttpClient.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ public function reset(): void
9696
}
9797

9898
/**
99-
* @deprecated since Symfony 7.1, configure the logger on the wrapper HTTP client directly instead
99+
* @deprecated since Symfony 7.1, configure the logger on the wrapped HTTP client directly instead
100100
*/
101101
public function setLogger(LoggerInterface $logger): void
102102
{
103-
trigger_deprecation('symfony/http-client', '7.1', 'Configure the logger on the wrapper HTTP client directly instead.');
103+
trigger_deprecation('symfony/http-client', '7.1', 'Configure the logger on the wrapped HTTP client directly instead.');
104104

105105
if ($this->client instanceof LoggerAwareInterface) {
106106
$this->client->setLogger($logger);

src/Symfony/Component/HttpClient/TraceableHttpClient.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ public function reset(): void
8888
}
8989

9090
/**
91-
* @deprecated since Symfony 7.1, configure the logger on the wrapper HTTP client directly instead
91+
* @deprecated since Symfony 7.1, configure the logger on the wrapped HTTP client directly instead
9292
*/
9393
public function setLogger(LoggerInterface $logger): void
9494
{
95-
trigger_deprecation('symfony/http-client', '7.1', 'Configure the logger on the wrapper HTTP client directly instead.');
95+
trigger_deprecation('symfony/http-client', '7.1', 'Configure the logger on the wrapped HTTP client directly instead.');
9696

9797
if ($this->client instanceof LoggerAwareInterface) {
9898
$this->client->setLogger($logger);

src/Symfony/Component/Security/Core/Resources/translations/security.fa.xlf

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
</trans-unit>
7777
<trans-unit id="20">
7878
<source>Too many failed login attempts, please try again in %minutes% minutes.</source>
79-
<target state="needs-review-translation">تعداد دفعات تلاش برای ورود بیش از حد زیاد است، لطفا پس از %minutes% دقیقه دوباره تلاش کنید.</target>
79+
<target>تعداد دفعات تلاش برای ورود بیش از حد زیاد است، لطفا پس از %minutes% دقیقه دوباره تلاش کنید.</target>
8080
</trans-unit>
8181
</body>
8282
</file>

src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf

+11-11
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
</trans-unit>
3737
<trans-unit id="9">
3838
<source>This field was not expected.</source>
39-
<target state="needs-review-translation">این فیلد انتظار نمی‌رفت.</target>
39+
<target>این ورودی مورد انتظار نبود.</target>
4040
</trans-unit>
4141
<trans-unit id="10">
4242
<source>This field is missing.</source>
43-
<target state="needs-review-translation">این فیلد گمشده است.</target>
43+
<target>این فیلد وارد نشده است.</target>
4444
</trans-unit>
4545
<trans-unit id="11">
4646
<source>This value is not a valid date.</source>
@@ -136,7 +136,7 @@
136136
</trans-unit>
137137
<trans-unit id="37" resname="This is not a valid IP address.">
138138
<source>This value is not a valid IP address.</source>
139-
<target state="needs-review-translation">این مقدار آدرس IP معتبری نیست.</target>
139+
<target>این مقدار یه آدرس آی‌پی معتبر نمی‌باشد.</target>
140140
</trans-unit>
141141
<trans-unit id="38">
142142
<source>This value is not a valid language.</source>
@@ -192,7 +192,7 @@
192192
</trans-unit>
193193
<trans-unit id="51" resname="No temporary folder was configured in php.ini.">
194194
<source>No temporary folder was configured in php.ini, or the configured folder does not exist.</source>
195-
<target state="needs-review-translation">هیچ پوشه موقتی در php.ini پیکربندی نشده است، یا پوشه پیکربندی شده وجود ندارد.</target>
195+
<target>هیچ پوشه موقتی در php.ini پیکربندی نشده است، یا پوشه پیکربندی شده وجود ندارد.</target>
196196
</trans-unit>
197197
<trans-unit id="52">
198198
<source>Cannot write temporary file to disk.</source>
@@ -224,7 +224,7 @@
224224
</trans-unit>
225225
<trans-unit id="59" resname="This is not a valid International Bank Account Number (IBAN).">
226226
<source>This value is not a valid International Bank Account Number (IBAN).</source>
227-
<target state="needs-review-translation">این مقدار یک شماره حساب بانکی بین‌المللی (IBAN) معتبر نیست.</target>
227+
<target>این مقدار یک شماره شبای معتبر نمی‌باشد.</target>
228228
</trans-unit>
229229
<trans-unit id="60">
230230
<source>This value is not a valid ISBN-10.</source>
@@ -312,15 +312,15 @@
312312
</trans-unit>
313313
<trans-unit id="81" resname="This is not a valid Business Identifier Code (BIC).">
314314
<source>This value is not a valid Business Identifier Code (BIC).</source>
315-
<target state="needs-review-translation">این مقدار یک کد شناسه کسب‌وکار (BIC) معتبر نیست.</target>
315+
<target>این مقدار یک کد شناسه کسب‌وکار (BIC) معتبر نیست.</target>
316316
</trans-unit>
317317
<trans-unit id="82">
318318
<source>Error</source>
319319
<target>خطا</target>
320320
</trans-unit>
321321
<trans-unit id="83" resname="This is not a valid UUID.">
322322
<source>This value is not a valid UUID.</source>
323-
<target state="needs-review-translation">این مقدار یک UUID معتبر نیست.</target>
323+
<target>این مقدار یک UUID معتبر نیست.</target>
324324
</trans-unit>
325325
<trans-unit id="84">
326326
<source>This value should be a multiple of {{ compared_value }}.</source>
@@ -428,19 +428,19 @@
428428
</trans-unit>
429429
<trans-unit id="110">
430430
<source>The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}.</source>
431-
<target state="needs-review-translation">پسوند فایل نامعتبر است ({{ extension }}). پسوندهای مجاز {{ extensions }} هستند.</target>
431+
<target>پسوند فایل ({{ extension }}) نامعتبر است. پسوندهای مجاز {{ extensions }} هستند.</target>
432432
</trans-unit>
433433
<trans-unit id="111">
434434
<source>The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}.</source>
435-
<target state="needs-review-translation">رمزگذاری کاراکتر تشخیص داده شده نامعتبر است ({{ detected }}). رمزگذاری‌های مجاز {{ encodings }} هستند.</target>
435+
<target>رمزگذاری کاراکتر تشخیص داده شده ({{ detected }}) نامعتبر است. رمزگذاری‌های مجاز {{ encodings }} هستند.</target>
436436
</trans-unit>
437437
<trans-unit id="112">
438438
<source>This value is not a valid MAC address.</source>
439-
<target state="needs-review-translation">این مقدار یک آدرس MAC معتبر نیست.</target>
439+
<target>این مقدار یک آدرس MAC معتبر نیست.</target>
440440
</trans-unit>
441441
<trans-unit id="113">
442442
<source>This URL is missing a top-level domain.</source>
443-
<target state="needs-review-translation">این URL فاقد دامنه سطح بالا است.</target>
443+
<target>این آدرس دارای دامنه نمی‌باشد.</target>
444444
</trans-unit>
445445
<trans-unit id="114">
446446
<source>This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words.</source>

0 commit comments

Comments
 (0)