Skip to content

Commit 29927b2

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 5ee045b + 6e695b9 commit 29927b2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

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())

0 commit comments

Comments
 (0)