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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 11 additions & 0 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 14 additions & 0 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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>

0 commit comments

Comments
 (0)