From afa08775c14e13ba64b63c68dc7222590eb5b98d Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Wed, 10 Nov 2021 18:39:49 +0100 Subject: [PATCH 001/106] [HttpKernel] [HttpCache] Don't throw on 304 Not Modified --- HttpCache/AbstractSurrogate.php | 2 +- Tests/HttpCache/EsiTest.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/HttpCache/AbstractSurrogate.php b/HttpCache/AbstractSurrogate.php index 3385940243..9301d0c11b 100644 --- a/HttpCache/AbstractSurrogate.php +++ b/HttpCache/AbstractSurrogate.php @@ -95,7 +95,7 @@ public function handle(HttpCache $cache, $uri, $alt, $ignoreErrors) try { $response = $cache->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true); - if (!$response->isSuccessful()) { + if (!$response->isSuccessful() && Response::HTTP_NOT_MODIFIED !== $response->getStatusCode()) { throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %d).', $subRequest->getUri(), $response->getStatusCode())); } diff --git a/Tests/HttpCache/EsiTest.php b/Tests/HttpCache/EsiTest.php index e708c2ae5f..32bd3ac7b5 100644 --- a/Tests/HttpCache/EsiTest.php +++ b/Tests/HttpCache/EsiTest.php @@ -221,6 +221,15 @@ public function testHandleWhenResponseIsNot200AndAltIsPresent() $this->assertEquals('bar', $esi->handle($cache, '/', '/alt', false)); } + public function testHandleWhenResponseIsNotModified() + { + $esi = new Esi(); + $response = new Response(''); + $response->setStatusCode(304); + $cache = $this->getCache(Request::create('/'), $response); + $this->assertEquals('', $esi->handle($cache, '/', '/alt', true)); + } + protected function getCache($request, $response) { $cache = $this->getMockBuilder(HttpCache::class)->setMethods(['getRequest', 'handle'])->disableOriginalConstructor()->getMock(); From 728a19220b69f8ff1185ce934765d860186b2081 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 3 Mar 2022 11:39:01 +0100 Subject: [PATCH 002/106] [HttpKernel] Remove private headers before storing responses with HttpCache --- HttpCache/Store.php | 20 +++++++++++++++++--- Tests/HttpCache/StoreTest.php | 13 +++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/HttpCache/Store.php b/HttpCache/Store.php index eeb7a6ef94..43bd7c8082 100644 --- a/HttpCache/Store.php +++ b/HttpCache/Store.php @@ -26,19 +26,29 @@ class Store implements StoreInterface { protected $root; private $keyCache; - private $locks; + private $locks = []; + private $options; /** + * Constructor. + * + * The available options are: + * + * * private_headers Set of response headers that should not be stored + * when a response is cached. (default: Set-Cookie) + * * @throws \RuntimeException */ - public function __construct(string $root) + public function __construct(string $root, array $options = []) { $this->root = $root; if (!file_exists($this->root) && !@mkdir($this->root, 0777, true) && !is_dir($this->root)) { throw new \RuntimeException(sprintf('Unable to create the store directory (%s).', $this->root)); } $this->keyCache = new \SplObjectStorage(); - $this->locks = []; + $this->options = array_merge([ + 'private_headers' => ['Set-Cookie'], + ], $options); } /** @@ -215,6 +225,10 @@ public function write(Request $request, Response $response) $headers = $this->persistResponse($response); unset($headers['age']); + foreach ($this->options['private_headers'] as $h) { + unset($headers[strtolower($h)]); + } + array_unshift($entries, [$storedEnv, $headers]); if (!$this->save($key, serialize($entries))) { diff --git a/Tests/HttpCache/StoreTest.php b/Tests/HttpCache/StoreTest.php index da1f649127..239361bc8c 100644 --- a/Tests/HttpCache/StoreTest.php +++ b/Tests/HttpCache/StoreTest.php @@ -12,8 +12,10 @@ namespace Symfony\Component\HttpKernel\Tests\HttpCache; use PHPUnit\Framework\TestCase; +use Symfony\Component\HttpFoundation\Cookie; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\HttpCache\HttpCache; use Symfony\Component\HttpKernel\HttpCache\Store; class StoreTest extends TestCase @@ -317,6 +319,17 @@ public function testPurgeHttpAndHttps() $this->assertEmpty($this->getStoreMetadata($requestHttps)); } + public function testDoesNotStorePrivateHeaders() + { + $request = Request::create('https://example.com/foo'); + $response = new Response('foo'); + $response->headers->setCookie(Cookie::fromString('foo=bar')); + + $this->store->write($request, $response); + $this->assertArrayNotHasKey('set-cookie', $this->getStoreMetadata($request)[0][1]); + $this->assertNotEmpty($response->headers->getCookies()); + } + protected function storeSimpleEntry($path = null, $headers = []) { if (null === $path) { From c4c33fb9203e6f166ac0f318ce34e00686702522 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 26 Jun 2022 18:51:30 +0200 Subject: [PATCH 003/106] Update VERSION for 4.4.43 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 26aa46dd24..ca163944dd 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.43-DEV'; + public const VERSION = '4.4.43'; public const VERSION_ID = 40443; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 43; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From c54ca381440fc82b140806d4b93b1da3745ac6d8 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 26 Jun 2022 18:57:37 +0200 Subject: [PATCH 004/106] Bump Symfony version to 4.4.44 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index ca163944dd..0cfc09d51c 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.43'; - public const VERSION_ID = 40443; + public const VERSION = '4.4.44-DEV'; + public const VERSION_ID = 40444; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 43; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 44; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From 255ae3b0a488d78fbb34da23d3e0c059874b5948 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 26 Jun 2022 18:57:59 +0200 Subject: [PATCH 005/106] Update VERSION for 5.4.10 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 3962146803..f4e34ce028 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.10-DEV'; + public const VERSION = '5.4.10'; public const VERSION_ID = 50410; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 10; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 3b8592ede09b179c903a74ee447c0cdf97aa43c8 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 26 Jun 2022 19:01:52 +0200 Subject: [PATCH 006/106] Bump Symfony version to 5.4.11 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index f4e34ce028..ddfb2ec6d8 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.10'; - public const VERSION_ID = 50410; + public const VERSION = '5.4.11-DEV'; + public const VERSION_ID = 50411; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 10; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 11; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From fa3e92a78c3f311573671961c7f7a2c5bce0f54d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 26 Jun 2022 19:02:18 +0200 Subject: [PATCH 007/106] Update VERSION for 6.0.10 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index a8cf9f212e..7892031a72 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.10-DEV'; + public const VERSION = '6.0.10'; public const VERSION_ID = 60010; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; public const RELEASE_VERSION = 10; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 07a7de3a6c2defcb39d55f06466430a7253efd7e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 26 Jun 2022 19:05:46 +0200 Subject: [PATCH 008/106] Bump Symfony version to 6.0.11 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 7892031a72..231a8ab98b 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.10'; - public const VERSION_ID = 60010; + public const VERSION = '6.0.11-DEV'; + public const VERSION_ID = 60011; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; - public const RELEASE_VERSION = 10; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 11; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From ad64ad4749721a27f4249a8dcc525d65add0ff77 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 26 Jun 2022 19:09:14 +0200 Subject: [PATCH 009/106] Bump Symfony version to 6.1.3 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 44beb5ca27..c49ef8e11b 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.2'; - public const VERSION_ID = 60102; + public const VERSION = '6.1.3-DEV'; + public const VERSION_ID = 60103; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; - public const RELEASE_VERSION = 2; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 3; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 3503e3e1c8ba3eb8d1255288f3dab691922d7199 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 27 Jun 2022 15:16:42 +0200 Subject: [PATCH 010/106] CS fixes --- DataCollector/ConfigDataCollector.php | 4 ++-- DataCollector/DumpDataCollector.php | 6 +++--- DataCollector/MemoryDataCollector.php | 2 +- Debug/FileLinkFormatter.php | 2 +- Fragment/AbstractSurrogateFragmentRenderer.php | 2 +- Fragment/RoutableFragmentRenderer.php | 2 +- Log/Logger.php | 2 +- Tests/DataCollector/ConfigDataCollectorTest.php | 8 ++++---- Tests/KernelTest.php | 2 +- Tests/Profiler/FileProfilerStorageTest.php | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/DataCollector/ConfigDataCollector.php b/DataCollector/ConfigDataCollector.php index 2d3ad5ce4a..660b25204c 100644 --- a/DataCollector/ConfigDataCollector.php +++ b/DataCollector/ConfigDataCollector.php @@ -79,8 +79,8 @@ public function collect(Request $request, Response $response/*, \Throwable $exce 'php_intl_locale' => class_exists(\Locale::class, false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a', 'php_timezone' => date_default_timezone_get(), 'xdebug_enabled' => \extension_loaded('xdebug'), - 'apcu_enabled' => \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN), - 'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN), + 'apcu_enabled' => \extension_loaded('apcu') && filter_var(\ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN), + 'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN), 'bundles' => [], 'sapi_name' => \PHP_SAPI, ]; diff --git a/DataCollector/DumpDataCollector.php b/DataCollector/DumpDataCollector.php index a66224b6f4..c537a6749c 100644 --- a/DataCollector/DumpDataCollector.php +++ b/DataCollector/DumpDataCollector.php @@ -50,8 +50,8 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface public function __construct(Stopwatch $stopwatch = null, $fileLinkFormat = null, string $charset = null, RequestStack $requestStack = null, $dumper = null) { $this->stopwatch = $stopwatch; - $this->fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); - $this->charset = $charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8'; + $this->fileLinkFormat = $fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); + $this->charset = $charset ?: \ini_get('php.output_encoding') ?: \ini_get('default_charset') ?: 'UTF-8'; $this->requestStack = $requestStack; $this->dumper = $dumper; @@ -237,7 +237,7 @@ public function __destruct() $h = headers_list(); $i = \count($h); - array_unshift($h, 'Content-Type: '.ini_get('default_mimetype')); + array_unshift($h, 'Content-Type: '.\ini_get('default_mimetype')); while (0 !== stripos($h[$i], 'Content-Type:')) { --$i; } diff --git a/DataCollector/MemoryDataCollector.php b/DataCollector/MemoryDataCollector.php index 7119bf31ad..5e6d856635 100644 --- a/DataCollector/MemoryDataCollector.php +++ b/DataCollector/MemoryDataCollector.php @@ -45,7 +45,7 @@ public function reset() { $this->data = [ 'memory' => 0, - 'memory_limit' => $this->convertToBytes(ini_get('memory_limit')), + 'memory_limit' => $this->convertToBytes(\ini_get('memory_limit')), ]; } diff --git a/Debug/FileLinkFormatter.php b/Debug/FileLinkFormatter.php index 27c71708b2..a60b22a9d7 100644 --- a/Debug/FileLinkFormatter.php +++ b/Debug/FileLinkFormatter.php @@ -34,7 +34,7 @@ class FileLinkFormatter */ public function __construct(string $fileLinkFormat = null, RequestStack $requestStack = null, string $baseDir = null, $urlFormat = null) { - $fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); + $fileLinkFormat = $fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); if ($fileLinkFormat && !\is_array($fileLinkFormat)) { $i = strpos($f = $fileLinkFormat, '&', max(strrpos($f, '%f'), strrpos($f, '%l'))) ?: \strlen($f); $fileLinkFormat = [substr($f, 0, $i)] + preg_split('/&([^>]++)>/', substr($f, $i), -1, \PREG_SPLIT_DELIM_CAPTURE); diff --git a/Fragment/AbstractSurrogateFragmentRenderer.php b/Fragment/AbstractSurrogateFragmentRenderer.php index 06d8c380bd..dfa02a11be 100644 --- a/Fragment/AbstractSurrogateFragmentRenderer.php +++ b/Fragment/AbstractSurrogateFragmentRenderer.php @@ -98,7 +98,7 @@ private function containsNonScalars(array $values): bool foreach ($values as $value) { if (\is_array($value)) { return $this->containsNonScalars($value); - } elseif (!is_scalar($value) && null !== $value) { + } elseif (!\is_scalar($value) && null !== $value) { return true; } } diff --git a/Fragment/RoutableFragmentRenderer.php b/Fragment/RoutableFragmentRenderer.php index bd8f85b19a..bd86a42df5 100644 --- a/Fragment/RoutableFragmentRenderer.php +++ b/Fragment/RoutableFragmentRenderer.php @@ -80,7 +80,7 @@ private function checkNonScalar(array $values) foreach ($values as $key => $value) { if (\is_array($value)) { $this->checkNonScalar($value); - } elseif (!is_scalar($value) && null !== $value) { + } elseif (!\is_scalar($value) && null !== $value) { throw new \LogicException(sprintf('Controller attributes cannot contain non-scalar/non-null values (value for key "%s" is not a scalar or null).', $key)); } } diff --git a/Log/Logger.php b/Log/Logger.php index 3e1db33466..d7f297f586 100644 --- a/Log/Logger.php +++ b/Log/Logger.php @@ -91,7 +91,7 @@ private function format(string $level, string $message, array $context, bool $pr if (str_contains($message, '{')) { $replacements = []; foreach ($context as $key => $val) { - if (null === $val || is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) { + if (null === $val || \is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) { $replacements["{{$key}}"] = $val; } elseif ($val instanceof \DateTimeInterface) { $replacements["{{$key}}"] = $val->format(\DateTime::RFC3339); diff --git a/Tests/DataCollector/ConfigDataCollectorTest.php b/Tests/DataCollector/ConfigDataCollectorTest.php index 86bd394f56..89e266c64a 100644 --- a/Tests/DataCollector/ConfigDataCollectorTest.php +++ b/Tests/DataCollector/ConfigDataCollectorTest.php @@ -39,8 +39,8 @@ public function testCollect() $this->assertSame(4 === Kernel::MINOR_VERSION, $c->isSymfonyLts()); $this->assertNull($c->getToken()); $this->assertSame(\extension_loaded('xdebug'), $c->hasXDebug()); - $this->assertSame(\extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN), $c->hasZendOpcache()); - $this->assertSame(\extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN), $c->hasApcu()); + $this->assertSame(\extension_loaded('Zend OPcache') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN), $c->hasZendOpcache()); + $this->assertSame(\extension_loaded('apcu') && filter_var(\ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN), $c->hasApcu()); $this->assertSame(sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION), $c->getSymfonyMinorVersion()); $this->assertContains($c->getSymfonyState(), ['eol', 'eom', 'dev', 'stable']); @@ -83,8 +83,8 @@ public function testCollectWithoutKernel() $this->assertSame(4 === Kernel::MINOR_VERSION, $c->isSymfonyLts()); $this->assertNull($c->getToken()); $this->assertSame(\extension_loaded('xdebug'), $c->hasXDebug()); - $this->assertSame(\extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN), $c->hasZendOpcache()); - $this->assertSame(\extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN), $c->hasApcu()); + $this->assertSame(\extension_loaded('Zend OPcache') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN), $c->hasZendOpcache()); + $this->assertSame(\extension_loaded('apcu') && filter_var(\ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN), $c->hasApcu()); $this->assertSame(sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION), $c->getSymfonyMinorVersion()); $this->assertContains($c->getSymfonyState(), ['eol', 'eom', 'dev', 'stable']); diff --git a/Tests/KernelTest.php b/Tests/KernelTest.php index ec57289dde..dacb8a5829 100644 --- a/Tests/KernelTest.php +++ b/Tests/KernelTest.php @@ -662,7 +662,7 @@ public function testKernelStartTimeIsResetWhileBootingAlreadyBootedKernel() $kernel->boot(); $preReBoot = $kernel->getStartTime(); - sleep(3600); //Intentionally large value to detect if ClockMock ever breaks + sleep(3600); // Intentionally large value to detect if ClockMock ever breaks $kernel->reboot(null); $this->assertGreaterThan($preReBoot, $kernel->getStartTime()); diff --git a/Tests/Profiler/FileProfilerStorageTest.php b/Tests/Profiler/FileProfilerStorageTest.php index d2daa67bce..884c446ae6 100644 --- a/Tests/Profiler/FileProfilerStorageTest.php +++ b/Tests/Profiler/FileProfilerStorageTest.php @@ -272,7 +272,7 @@ public function testDuplicates() $profile->setUrl('http://example.net/'); $profile->setMethod('GET'); - ///three duplicates + // three duplicates $this->storage->write($profile); $this->storage->write($profile); $this->storage->write($profile); From eefc100b1d93aa459c370226f4e6b2cd1ba79842 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 20 Jul 2022 11:29:12 +0200 Subject: [PATCH 011/106] Fix CS --- Config/FileLocator.php | 2 +- DataCollector/AjaxDataCollector.php | 2 +- DataCollector/ConfigDataCollector.php | 2 +- DataCollector/DataCollectorInterface.php | 2 +- DataCollector/DumpDataCollector.php | 2 +- DataCollector/EventDataCollector.php | 2 +- DataCollector/ExceptionDataCollector.php | 2 +- DataCollector/LoggerDataCollector.php | 2 +- DataCollector/MemoryDataCollector.php | 5 ++++- DataCollector/RequestDataCollector.php | 2 +- DataCollector/RouterDataCollector.php | 2 +- DataCollector/TimeDataCollector.php | 2 +- Kernel.php | 2 +- KernelInterface.php | 2 +- Profiler/Profiler.php | 2 +- Tests/EventListener/SessionListenerTest.php | 4 ++-- 16 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Config/FileLocator.php b/Config/FileLocator.php index a302419701..2dda23470a 100644 --- a/Config/FileLocator.php +++ b/Config/FileLocator.php @@ -28,7 +28,7 @@ class FileLocator extends BaseFileLocator */ private $path; - public function __construct(KernelInterface $kernel/*, string $path = null, array $paths = [], bool $triggerDeprecation = true*/) + public function __construct(KernelInterface $kernel/* , string $path = null, array $paths = [], bool $triggerDeprecation = true */) { $this->kernel = $kernel; diff --git a/DataCollector/AjaxDataCollector.php b/DataCollector/AjaxDataCollector.php index 356ce227e8..a134ebc25f 100644 --- a/DataCollector/AjaxDataCollector.php +++ b/DataCollector/AjaxDataCollector.php @@ -28,7 +28,7 @@ class AjaxDataCollector extends DataCollector * * @param \Throwable|null $exception */ - public function collect(Request $request, Response $response/*, \Throwable $exception = null*/) + public function collect(Request $request, Response $response/* , \Throwable $exception = null */) { // all collecting is done client side } diff --git a/DataCollector/ConfigDataCollector.php b/DataCollector/ConfigDataCollector.php index 660b25204c..91b62899fa 100644 --- a/DataCollector/ConfigDataCollector.php +++ b/DataCollector/ConfigDataCollector.php @@ -57,7 +57,7 @@ public function setKernel(KernelInterface $kernel = null) * * @param \Throwable|null $exception */ - public function collect(Request $request, Response $response/*, \Throwable $exception = null*/) + public function collect(Request $request, Response $response/* , \Throwable $exception = null */) { $eom = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE); $eol = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE); diff --git a/DataCollector/DataCollectorInterface.php b/DataCollector/DataCollectorInterface.php index a302ad3009..2ee955ba0c 100644 --- a/DataCollector/DataCollectorInterface.php +++ b/DataCollector/DataCollectorInterface.php @@ -27,7 +27,7 @@ interface DataCollectorInterface extends ResetInterface * * @param \Throwable|null $exception */ - public function collect(Request $request, Response $response/*, \Throwable $exception = null*/); + public function collect(Request $request, Response $response/* , \Throwable $exception = null */); /** * Returns the name of the collector. diff --git a/DataCollector/DumpDataCollector.php b/DataCollector/DumpDataCollector.php index c537a6749c..af29554928 100644 --- a/DataCollector/DumpDataCollector.php +++ b/DataCollector/DumpDataCollector.php @@ -105,7 +105,7 @@ public function dump(Data $data) * * @param \Throwable|null $exception */ - public function collect(Request $request, Response $response/*, \Throwable $exception = null*/) + public function collect(Request $request, Response $response/* , \Throwable $exception = null */) { if (!$this->dataCount) { $this->data = []; diff --git a/DataCollector/EventDataCollector.php b/DataCollector/EventDataCollector.php index 89fd183386..24ed55961e 100644 --- a/DataCollector/EventDataCollector.php +++ b/DataCollector/EventDataCollector.php @@ -43,7 +43,7 @@ public function __construct(EventDispatcherInterface $dispatcher = null, Request * * @param \Throwable|null $exception */ - public function collect(Request $request, Response $response/*, \Throwable $exception = null*/) + public function collect(Request $request, Response $response/* , \Throwable $exception = null */) { $this->currentRequest = $this->requestStack && $this->requestStack->getMasterRequest() !== $request ? $request : null; $this->data = [ diff --git a/DataCollector/ExceptionDataCollector.php b/DataCollector/ExceptionDataCollector.php index 222cae5d2d..9868659b93 100644 --- a/DataCollector/ExceptionDataCollector.php +++ b/DataCollector/ExceptionDataCollector.php @@ -29,7 +29,7 @@ class ExceptionDataCollector extends DataCollector * * @param \Throwable|null $exception */ - public function collect(Request $request, Response $response/*, \Throwable $exception = null*/) + public function collect(Request $request, Response $response/* , \Throwable $exception = null */) { $exception = 2 < \func_num_args() ? func_get_arg(2) : null; diff --git a/DataCollector/LoggerDataCollector.php b/DataCollector/LoggerDataCollector.php index 0e25f8960f..849adfd8cd 100644 --- a/DataCollector/LoggerDataCollector.php +++ b/DataCollector/LoggerDataCollector.php @@ -44,7 +44,7 @@ public function __construct($logger = null, string $containerPathPrefix = null, * * @param \Throwable|null $exception */ - public function collect(Request $request, Response $response/*, \Throwable $exception = null*/) + public function collect(Request $request, Response $response/* , \Throwable $exception = null */) { $this->currentRequest = $this->requestStack && $this->requestStack->getMasterRequest() !== $request ? $request : null; } diff --git a/DataCollector/MemoryDataCollector.php b/DataCollector/MemoryDataCollector.php index 5e6d856635..f6015bafad 100644 --- a/DataCollector/MemoryDataCollector.php +++ b/DataCollector/MemoryDataCollector.php @@ -33,7 +33,7 @@ public function __construct() * * @param \Throwable|null $exception */ - public function collect(Request $request, Response $response/*, \Throwable $exception = null*/) + public function collect(Request $request, Response $response/* , \Throwable $exception = null */) { $this->updateMemoryUsage(); } @@ -114,8 +114,11 @@ private function convertToBytes(string $memoryLimit) switch (substr($memoryLimit, -1)) { case 't': $max *= 1024; + // no break case 'g': $max *= 1024; + // no break case 'm': $max *= 1024; + // no break case 'k': $max *= 1024; } diff --git a/DataCollector/RequestDataCollector.php b/DataCollector/RequestDataCollector.php index 1fb226d13c..2147c678f2 100644 --- a/DataCollector/RequestDataCollector.php +++ b/DataCollector/RequestDataCollector.php @@ -39,7 +39,7 @@ public function __construct() * * @param \Throwable|null $exception */ - public function collect(Request $request, Response $response/*, \Throwable $exception = null*/) + public function collect(Request $request, Response $response/* , \Throwable $exception = null */) { // attributes are serialized and as they can be anything, they need to be converted to strings. $attributes = []; diff --git a/DataCollector/RouterDataCollector.php b/DataCollector/RouterDataCollector.php index 5f12392330..8ff676cc83 100644 --- a/DataCollector/RouterDataCollector.php +++ b/DataCollector/RouterDataCollector.php @@ -38,7 +38,7 @@ public function __construct() * * @final since Symfony 4.4 */ - public function collect(Request $request, Response $response/*, \Throwable $exception = null*/) + public function collect(Request $request, Response $response/* , \Throwable $exception = null */) { if ($response instanceof RedirectResponse) { $this->data['redirect'] = true; diff --git a/DataCollector/TimeDataCollector.php b/DataCollector/TimeDataCollector.php index b83c44a48d..c6166c8aae 100644 --- a/DataCollector/TimeDataCollector.php +++ b/DataCollector/TimeDataCollector.php @@ -38,7 +38,7 @@ public function __construct(KernelInterface $kernel = null, Stopwatch $stopwatch * * @param \Throwable|null $exception */ - public function collect(Request $request, Response $response/*, \Throwable $exception = null*/) + public function collect(Request $request, Response $response/* , \Throwable $exception = null */) { if (null !== $this->kernel) { $startTime = $this->kernel->getStartTime(); diff --git a/Kernel.php b/Kernel.php index 0cfc09d51c..9f132dcd9a 100644 --- a/Kernel.php +++ b/Kernel.php @@ -237,7 +237,7 @@ public function getBundle($name) /** * {@inheritdoc} */ - public function locateResource($name/*, $dir = null, $first = true, $triggerDeprecation = true*/) + public function locateResource($name/* , $dir = null, $first = true, $triggerDeprecation = true */) { if (2 <= \func_num_args()) { $dir = func_get_arg(1); diff --git a/KernelInterface.php b/KernelInterface.php index 00a1aec817..d18e3b22f0 100644 --- a/KernelInterface.php +++ b/KernelInterface.php @@ -87,7 +87,7 @@ public function getBundle($name); * @throws \InvalidArgumentException if the file cannot be found or the name is not valid * @throws \RuntimeException if the name contains invalid/unsafe characters */ - public function locateResource($name/*, $dir = null, $first = true*/); + public function locateResource($name/* , $dir = null, $first = true */); /** * Gets the name of the kernel. diff --git a/Profiler/Profiler.php b/Profiler/Profiler.php index 60a623684c..32bde2bbc9 100644 --- a/Profiler/Profiler.php +++ b/Profiler/Profiler.php @@ -143,7 +143,7 @@ public function find($ip, $url, $limit, $method, $start, $end, $statusCode = nul * * @return Profile|null A Profile instance or null if the profiler is disabled */ - public function collect(Request $request, Response $response/*, \Throwable $exception = null*/) + public function collect(Request $request, Response $response/* , \Throwable $exception = null */) { $exception = 2 < \func_num_args() ? func_get_arg(2) : null; diff --git a/Tests/EventListener/SessionListenerTest.php b/Tests/EventListener/SessionListenerTest.php index 9b49936f46..75a1ae7379 100644 --- a/Tests/EventListener/SessionListenerTest.php +++ b/Tests/EventListener/SessionListenerTest.php @@ -87,7 +87,7 @@ public function testResponseIsPrivateIfSessionStarted() $this->assertTrue($response->headers->hasCacheControlDirective('private')); $this->assertTrue($response->headers->hasCacheControlDirective('must-revalidate')); $this->assertSame('0', $response->headers->getCacheControlDirective('max-age')); - $this->assertLessThanOrEqual((new \DateTime('now', new \DateTimeZone('UTC'))), (new \DateTime($response->headers->get('Expires')))); + $this->assertLessThanOrEqual(new \DateTime('now', new \DateTimeZone('UTC')), new \DateTime($response->headers->get('Expires'))); $this->assertFalse($response->headers->has(AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER)); } @@ -193,7 +193,7 @@ public function testSurrogateMasterRequestIsPublic() $this->assertSame('0', $response->headers->getCacheControlDirective('max-age')); $this->assertTrue($response->headers->has('Expires')); - $this->assertLessThanOrEqual((new \DateTime('now', new \DateTimeZone('UTC'))), (new \DateTime($response->headers->get('Expires')))); + $this->assertLessThanOrEqual(new \DateTime('now', new \DateTimeZone('UTC')), new \DateTime($response->headers->get('Expires'))); } public function testGetSessionIsCalledOnce() From 550c151c177de15206f65b4c598c52d78a9cb779 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 20 Jul 2022 13:50:25 +0200 Subject: [PATCH 012/106] Fix CS --- DataCollector/MemoryDataCollector.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DataCollector/MemoryDataCollector.php b/DataCollector/MemoryDataCollector.php index a50d4d9056..53a1f9e448 100644 --- a/DataCollector/MemoryDataCollector.php +++ b/DataCollector/MemoryDataCollector.php @@ -100,8 +100,11 @@ private function convertToBytes(string $memoryLimit) switch (substr($memoryLimit, -1)) { case 't': $max *= 1024; + // no break case 'g': $max *= 1024; + // no break case 'm': $max *= 1024; + // no break case 'k': $max *= 1024; } From e7f20cdc18fdc6078317409120310e58a91f707f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 20 Jul 2022 15:55:56 +0200 Subject: [PATCH 013/106] Fix CS --- DataCollector/MemoryDataCollector.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DataCollector/MemoryDataCollector.php b/DataCollector/MemoryDataCollector.php index 7cc8296dad..bf98efca80 100644 --- a/DataCollector/MemoryDataCollector.php +++ b/DataCollector/MemoryDataCollector.php @@ -94,11 +94,11 @@ private function convertToBytes(string $memoryLimit): int|float switch (substr($memoryLimit, -1)) { case 't': $max *= 1024; - // no break + // no break case 'g': $max *= 1024; - // no break + // no break case 'm': $max *= 1024; - // no break + // no break case 'k': $max *= 1024; } From 91c2abb1fe3707e00a6955cb45319cff8ff82173 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 27 Jul 2022 18:05:11 +0200 Subject: [PATCH 014/106] Workaround disabled "var_dump" --- EventListener/DebugHandlersListener.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EventListener/DebugHandlersListener.php b/EventListener/DebugHandlersListener.php index 5027bd1169..6563487f36 100644 --- a/EventListener/DebugHandlersListener.php +++ b/EventListener/DebugHandlersListener.php @@ -54,7 +54,7 @@ class DebugHandlersListener implements EventSubscriberInterface */ public function __construct(callable $exceptionHandler = null, LoggerInterface $logger = null, $levels = \E_ALL, ?int $throwAt = \E_ALL, bool $scream = true, $fileLinkFormat = null, bool $scope = true) { - $handler = set_exception_handler('var_dump'); + $handler = set_exception_handler('is_int'); $this->earlyHandler = \is_array($handler) ? $handler[0] : null; restore_exception_handler(); @@ -80,7 +80,7 @@ public function configure(Event $event = null) } $this->firstCall = $this->hasTerminatedWithException = false; - $handler = set_exception_handler('var_dump'); + $handler = set_exception_handler('is_int'); $handler = \is_array($handler) ? $handler[0] : null; restore_exception_handler(); From 3613724382fd11522f5e82d69c4f87ebfc1b357c Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Wed, 27 Jul 2022 09:39:22 +0200 Subject: [PATCH 015/106] [HttpKernel] Fix non-scalar check in surrogate fragment renderer --- Fragment/AbstractSurrogateFragmentRenderer.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Fragment/AbstractSurrogateFragmentRenderer.php b/Fragment/AbstractSurrogateFragmentRenderer.php index dfa02a11be..f59f86247b 100644 --- a/Fragment/AbstractSurrogateFragmentRenderer.php +++ b/Fragment/AbstractSurrogateFragmentRenderer.php @@ -96,9 +96,11 @@ private function generateSignedFragmentUri(ControllerReference $uri, Request $re private function containsNonScalars(array $values): bool { foreach ($values as $value) { - if (\is_array($value)) { - return $this->containsNonScalars($value); - } elseif (!\is_scalar($value) && null !== $value) { + if (\is_scalar($value) || null === $value) { + continue; + } + + if (!\is_array($value) || $this->containsNonScalars($value)) { return true; } } From 60f7b05e87ac633035e4f81e4228afc52ffeb04e Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 29 Jul 2022 09:35:46 +0200 Subject: [PATCH 016/106] [HttpKernel] Fix test sensitivity on xdebug.file_link_format --- DataCollector/DumpDataCollector.php | 3 ++- Debug/FileLinkFormatter.php | 8 ++++---- Tests/DataCollector/DumpDataCollectorTest.php | 3 ++- Tests/Debug/FileLinkFormatterTest.php | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/DataCollector/DumpDataCollector.php b/DataCollector/DumpDataCollector.php index af29554928..155d41c3cf 100644 --- a/DataCollector/DumpDataCollector.php +++ b/DataCollector/DumpDataCollector.php @@ -49,8 +49,9 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface */ public function __construct(Stopwatch $stopwatch = null, $fileLinkFormat = null, string $charset = null, RequestStack $requestStack = null, $dumper = null) { + $fileLinkFormat = $fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); $this->stopwatch = $stopwatch; - $this->fileLinkFormat = $fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); + $this->fileLinkFormat = $fileLinkFormat instanceof FileLinkFormatter && false === $fileLinkFormat->format('', 0) ? false : $fileLinkFormat; $this->charset = $charset ?: \ini_get('php.output_encoding') ?: \ini_get('default_charset') ?: 'UTF-8'; $this->requestStack = $requestStack; $this->dumper = $dumper; diff --git a/Debug/FileLinkFormatter.php b/Debug/FileLinkFormatter.php index a60b22a9d7..c235b1dbb2 100644 --- a/Debug/FileLinkFormatter.php +++ b/Debug/FileLinkFormatter.php @@ -30,12 +30,12 @@ class FileLinkFormatter private $urlFormat; /** - * @param string|\Closure $urlFormat the URL format, or a closure that returns it on-demand + * @param string|array|null $fileLinkFormat + * @param string|\Closure $urlFormat the URL format, or a closure that returns it on-demand */ - public function __construct(string $fileLinkFormat = null, RequestStack $requestStack = null, string $baseDir = null, $urlFormat = null) + public function __construct($fileLinkFormat = null, RequestStack $requestStack = null, string $baseDir = null, $urlFormat = null) { - $fileLinkFormat = $fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); - if ($fileLinkFormat && !\is_array($fileLinkFormat)) { + if (!\is_array($fileLinkFormat) && $fileLinkFormat = $fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format')) { $i = strpos($f = $fileLinkFormat, '&', max(strrpos($f, '%f'), strrpos($f, '%l'))) ?: \strlen($f); $fileLinkFormat = [substr($f, 0, $i)] + preg_split('/&([^>]++)>/', substr($f, $i), -1, \PREG_SPLIT_DELIM_CAPTURE); } diff --git a/Tests/DataCollector/DumpDataCollectorTest.php b/Tests/DataCollector/DumpDataCollectorTest.php index c69166bf09..b86e53df79 100644 --- a/Tests/DataCollector/DumpDataCollectorTest.php +++ b/Tests/DataCollector/DumpDataCollectorTest.php @@ -15,6 +15,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\DataCollector\DumpDataCollector; +use Symfony\Component\HttpKernel\Debug\FileLinkFormatter; use Symfony\Component\VarDumper\Cloner\Data; use Symfony\Component\VarDumper\Dumper\CliDumper; use Symfony\Component\VarDumper\Server\Connection; @@ -28,7 +29,7 @@ public function testDump() { $data = new Data([[123]]); - $collector = new DumpDataCollector(); + $collector = new DumpDataCollector(null, new FileLinkFormatter([])); $this->assertSame('dump', $collector->getName()); diff --git a/Tests/Debug/FileLinkFormatterTest.php b/Tests/Debug/FileLinkFormatterTest.php index 1f4d298bf3..f649455764 100644 --- a/Tests/Debug/FileLinkFormatterTest.php +++ b/Tests/Debug/FileLinkFormatterTest.php @@ -20,7 +20,7 @@ class FileLinkFormatterTest extends TestCase { public function testWhenNoFileLinkFormatAndNoRequest() { - $sut = new FileLinkFormatter(); + $sut = new FileLinkFormatter([]); $this->assertFalse($sut->format('/kernel/root/src/my/very/best/file.php', 3)); } @@ -47,7 +47,7 @@ public function testWhenNoFileLinkFormatAndRequest() $request->server->set('SCRIPT_FILENAME', '/public/index.php'); $request->server->set('REQUEST_URI', '/index.php/example'); - $sut = new FileLinkFormatter(null, $requestStack, __DIR__, '/_profiler/open?file=%f&line=%l#line%l'); + $sut = new FileLinkFormatter([], $requestStack, __DIR__, '/_profiler/open?file=%f&line=%l#line%l'); $this->assertSame('http://www.example.org/_profiler/open?file=file.php&line=3#line3', $sut->format($file, 3)); } From 9e444442334fae9637ef3209bc2abddfef49e714 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 29 Jul 2022 14:23:38 +0200 Subject: [PATCH 017/106] Update VERSION for 4.4.44 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 9f132dcd9a..978324f29f 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.44-DEV'; + public const VERSION = '4.4.44'; public const VERSION_ID = 40444; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 44; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From 3ec963a73fae9d938687a322e6908bf4fe9e7fcb Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 29 Jul 2022 14:27:20 +0200 Subject: [PATCH 018/106] Bump Symfony version to 4.4.45 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 978324f29f..3a699112e1 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.44'; - public const VERSION_ID = 40444; + public const VERSION = '4.4.45-DEV'; + public const VERSION_ID = 40445; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 44; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 45; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From 4fd590a2ef3f62560dbbf6cea511995dd77321ee Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 29 Jul 2022 14:30:22 +0200 Subject: [PATCH 019/106] Update VERSION for 5.4.11 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index ddfb2ec6d8..358b926460 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.11-DEV'; + public const VERSION = '5.4.11'; public const VERSION_ID = 50411; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 11; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 628f67714b9ca6316546607c690af6d2d41884d8 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 29 Jul 2022 14:36:18 +0200 Subject: [PATCH 020/106] Bump Symfony version to 5.4.12 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 358b926460..266492171b 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.11'; - public const VERSION_ID = 50411; + public const VERSION = '5.4.12-DEV'; + public const VERSION_ID = 50412; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 11; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 12; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 961268a36f3fa4bda9fde1400d2ae7004318b717 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 29 Jul 2022 14:37:40 +0200 Subject: [PATCH 021/106] Update VERSION for 6.0.11 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 231a8ab98b..238b96c60b 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.11-DEV'; + public const VERSION = '6.0.11'; public const VERSION_ID = 60011; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; public const RELEASE_VERSION = 11; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From f8ccdb633e087d2ffba264959d94bba2395d5ea1 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 29 Jul 2022 14:58:40 +0200 Subject: [PATCH 022/106] Bump Symfony version to 6.0.12 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 238b96c60b..8b3106f5b9 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.11'; - public const VERSION_ID = 60011; + public const VERSION = '6.0.12-DEV'; + public const VERSION_ID = 60012; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; - public const RELEASE_VERSION = 11; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 12; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 0692bc185a1dbb54864686a1fc6785667279da70 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 29 Jul 2022 14:59:10 +0200 Subject: [PATCH 023/106] Update VERSION for 6.1.3 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index c49ef8e11b..29c7aac081 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.3-DEV'; + public const VERSION = '6.1.3'; public const VERSION_ID = 60103; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; public const RELEASE_VERSION = 3; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From f1831fe259131c6cd6383a4252b7b3a2daf0f912 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 29 Jul 2022 15:07:33 +0200 Subject: [PATCH 024/106] Bump Symfony version to 6.1.4 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 29c7aac081..b36b18c3a6 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.3'; - public const VERSION_ID = 60103; + public const VERSION = '6.1.4-DEV'; + public const VERSION_ID = 60104; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; - public const RELEASE_VERSION = 3; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 4; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From ee9a83aa1f7e248ce58352578fe9fa646febf4e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sama=C3=ABl=20Villette?= Date: Wed, 10 Aug 2022 09:21:11 +0200 Subject: [PATCH 025/106] [HttpKernel] Fix passing `null` to `\trim()` method in LoggerDataCollector --- DataCollector/LoggerDataCollector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataCollector/LoggerDataCollector.php b/DataCollector/LoggerDataCollector.php index 15094fdbed..2bbd2a039e 100644 --- a/DataCollector/LoggerDataCollector.php +++ b/DataCollector/LoggerDataCollector.php @@ -144,7 +144,7 @@ public function getFilters() $allChannels = []; foreach ($this->getProcessedLogs() as $log) { - if ('' === trim($log['channel'])) { + if ('' === trim($log['channel'] ?? '')) { continue; } From 7dee7f02bf99c0b537d88441e31d719bc2923c42 Mon Sep 17 00:00:00 2001 From: Antonio Pauletich Date: Sun, 14 Aug 2022 02:40:10 +0200 Subject: [PATCH 026/106] Do not send deleted session cookie twice in the response --- EventListener/AbstractSessionListener.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/EventListener/AbstractSessionListener.php b/EventListener/AbstractSessionListener.php index d0e8f45d03..4603052e93 100644 --- a/EventListener/AbstractSessionListener.php +++ b/EventListener/AbstractSessionListener.php @@ -158,6 +158,11 @@ public function onKernelResponse(ResponseEvent $event) $isSessionEmpty = $session->isEmpty() && empty($_SESSION); // checking $_SESSION to keep compatibility with native sessions if ($requestSessionCookieId && $isSessionEmpty) { + // PHP internally sets the session cookie value to "deleted" when setcookie() is called with empty string $value argument + // which happens in \Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler::destroy + // when the session gets invalidated (for example on logout) so we must handle this case here too + // otherwise we would send two Set-Cookie headers back with the response + SessionUtils::popSessionCookie($sessionName, 'deleted'); $response->headers->clearCookie( $sessionName, $sessionCookiePath, From 15baea58ba30612f3a72fb9da05883c18ee9a078 Mon Sep 17 00:00:00 2001 From: Warxcell Date: Mon, 22 Aug 2022 18:00:58 +0300 Subject: [PATCH 027/106] Fix RequestStack state if throwable is thrown --- HttpKernel.php | 6 +++--- Tests/HttpKernelTest.php | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/HttpKernel.php b/HttpKernel.php index 0ed82d777b..d53b80665b 100644 --- a/HttpKernel.php +++ b/HttpKernel.php @@ -76,6 +76,7 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ { $request->headers->set('X-Php-Ob-Level', (string) ob_get_level()); + $this->requestStack->push($request); try { return $this->handleRaw($request, $type); } catch (\Exception $e) { @@ -89,6 +90,8 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ } return $this->handleThrowable($e, $request, $type); + } finally { + $this->requestStack->pop(); } } @@ -127,8 +130,6 @@ public function terminateWithException(\Throwable $exception, Request $request = */ private function handleRaw(Request $request, int $type = self::MASTER_REQUEST): Response { - $this->requestStack->push($request); - // request $event = new RequestEvent($this, $request, $type); $this->dispatcher->dispatch($event, KernelEvents::REQUEST); @@ -205,7 +206,6 @@ private function filterResponse(Response $response, Request $request, int $type) private function finishRequest(Request $request, int $type) { $this->dispatcher->dispatch(new FinishRequestEvent($this, $request, $type), KernelEvents::FINISH_REQUEST); - $this->requestStack->pop(); } /** diff --git a/Tests/HttpKernelTest.php b/Tests/HttpKernelTest.php index 014dc752c3..53e5f547d2 100644 --- a/Tests/HttpKernelTest.php +++ b/Tests/HttpKernelTest.php @@ -39,6 +39,45 @@ public function testHandleWhenControllerThrowsAnExceptionAndCatchIsTrue() $kernel->handle(new Request(), HttpKernelInterface::MASTER_REQUEST, true); } + public function testRequestStackIsNotBrokenWhenControllerThrowsAnExceptionAndCatchIsTrue() + { + $requestStack = new RequestStack(); + $kernel = $this->getHttpKernel(new EventDispatcher(), function () { throw new \RuntimeException(); }, $requestStack); + + try { + $kernel->handle(new Request(), HttpKernelInterface::MASTER_REQUEST, true); + } catch (\Throwable $exception) { + } + + self::assertNull($requestStack->getCurrentRequest()); + } + + public function testRequestStackIsNotBrokenWhenControllerThrowsAnExceptionAndCatchIsFalse() + { + $requestStack = new RequestStack(); + $kernel = $this->getHttpKernel(new EventDispatcher(), function () { throw new \RuntimeException(); }, $requestStack); + + try { + $kernel->handle(new Request(), HttpKernelInterface::MASTER_REQUEST, false); + } catch (\Throwable $exception) { + } + + self::assertNull($requestStack->getCurrentRequest()); + } + + public function testRequestStackIsNotBrokenWhenControllerThrowsAnThrowable() + { + $requestStack = new RequestStack(); + $kernel = $this->getHttpKernel(new EventDispatcher(), function () { throw new \Error(); }, $requestStack); + + try { + $kernel->handle(new Request(), HttpKernelInterface::MASTER_REQUEST, true); + } catch (\Throwable $exception) { + } + + self::assertNull($requestStack->getCurrentRequest()); + } + public function testHandleWhenControllerThrowsAnExceptionAndCatchIsFalseAndNoListenerIsRegistered() { $this->expectException(\RuntimeException::class); From 4f2d38e9a3c6997ea0886ede5aaf337dfd0fc938 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 26 Aug 2022 16:34:48 +0200 Subject: [PATCH 028/106] Update VERSION for 4.4.45 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 3a699112e1..adb9a94727 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.45-DEV'; + public const VERSION = '4.4.45'; public const VERSION_ID = 40445; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 45; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From 721fef27e9721c59f4213262c7b5f1815571ec07 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 26 Aug 2022 16:40:14 +0200 Subject: [PATCH 029/106] Bump Symfony version to 4.4.46 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index adb9a94727..09c0f68162 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.45'; - public const VERSION_ID = 40445; + public const VERSION = '4.4.46-DEV'; + public const VERSION_ID = 40446; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 45; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 46; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From 37f660fa3bcd78fe4893ce23ebe934618ec099be Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 26 Aug 2022 16:40:40 +0200 Subject: [PATCH 030/106] Update VERSION for 5.4.12 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 266492171b..efedd884ad 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.12-DEV'; + public const VERSION = '5.4.12'; public const VERSION_ID = 50412; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 12; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 79ea489538c33b95cc90b7d746315c1855f29739 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 26 Aug 2022 16:44:24 +0200 Subject: [PATCH 031/106] Bump Symfony version to 5.4.13 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index efedd884ad..7a7e678a4f 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.12'; - public const VERSION_ID = 50412; + public const VERSION = '5.4.13-DEV'; + public const VERSION_ID = 50413; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 12; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 13; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 8f3563e4518cfee24a5cc724434cc60e0818abec Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 26 Aug 2022 16:45:39 +0200 Subject: [PATCH 032/106] Update VERSION for 6.0.12 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 8b3106f5b9..697a69b4bc 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.12-DEV'; + public const VERSION = '6.0.12'; public const VERSION_ID = 60012; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; public const RELEASE_VERSION = 12; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From bc44d471cc9ac3ca2ebe3ef415d0d6c7e018539d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 26 Aug 2022 16:49:37 +0200 Subject: [PATCH 033/106] Bump Symfony version to 6.0.13 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 697a69b4bc..eb53328f2c 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.12'; - public const VERSION_ID = 60012; + public const VERSION = '6.0.13-DEV'; + public const VERSION_ID = 60013; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; - public const RELEASE_VERSION = 12; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 13; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 2144c53a278254af57fa1e6f71427be656fab6f4 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 26 Aug 2022 16:50:30 +0200 Subject: [PATCH 034/106] Update VERSION for 6.1.4 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index b36b18c3a6..ec49d1a018 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.4-DEV'; + public const VERSION = '6.1.4'; public const VERSION_ID = 60104; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; public const RELEASE_VERSION = 4; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From b7d593c7c43d6d94490cb164a316befc3fb90580 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 26 Aug 2022 16:54:57 +0200 Subject: [PATCH 035/106] Bump Symfony version to 6.1.5 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index ec49d1a018..69d906ccd6 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.4'; - public const VERSION_ID = 60104; + public const VERSION = '6.1.5-DEV'; + public const VERSION_ID = 60105; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; - public const RELEASE_VERSION = 4; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 5; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From dca2563c109e50fefeddefc99081a6bc10ace48e Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 30 Aug 2022 18:39:01 +0200 Subject: [PATCH 036/106] [HttpKernel] lock when writting profiles --- Profiler/FileProfilerStorage.php | 56 ++++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/Profiler/FileProfilerStorage.php b/Profiler/FileProfilerStorage.php index d729994c1f..aa494691d1 100644 --- a/Profiler/FileProfilerStorage.php +++ b/Profiler/FileProfilerStorage.php @@ -115,19 +115,7 @@ public function purge() */ public function read($token): ?Profile { - if (!$token || !file_exists($file = $this->getFilename($token))) { - return null; - } - - if (\function_exists('gzcompress')) { - $file = 'compress.zlib://'.$file; - } - - if (!$data = unserialize(file_get_contents($file))) { - return null; - } - - return $this->createProfileFromData($token, $data); + return $this->doRead($token); } /** @@ -169,14 +157,13 @@ public function write(Profile $profile): bool 'status_code' => $profile->getStatusCode(), ]; - $context = stream_context_create(); + $data = serialize($data); - if (\function_exists('gzcompress')) { - $file = 'compress.zlib://'.$file; - stream_context_set_option($context, 'zlib', 'level', 3); + if (\function_exists('gzencode')) { + $data = gzencode($data, 3); } - if (false === file_put_contents($file, serialize($data), 0, $context)) { + if (false === file_put_contents($file, $data, \LOCK_EX)) { return false; } @@ -293,21 +280,34 @@ protected function createProfileFromData($token, $data, $parent = null) } foreach ($data['children'] as $token) { - if (!$token || !file_exists($file = $this->getFilename($token))) { - continue; + if (null !== $childProfile = $this->doRead($token, $profile)) { + $profile->addChild($childProfile); } + } - if (\function_exists('gzcompress')) { - $file = 'compress.zlib://'.$file; - } + return $profile; + } - if (!$childData = unserialize(file_get_contents($file))) { - continue; - } + private function doRead($token, Profile $profile = null): ?Profile + { + if (!$token || !file_exists($file = $this->getFilename($token))) { + return null; + } + + $h = fopen($file, 'r'); + flock($h, \LOCK_SH); + $data = stream_get_contents($h); + flock($h, \LOCK_UN); + fclose($h); - $profile->addChild($this->createProfileFromData($token, $childData, $profile)); + if (\function_exists('gzdecode')) { + $data = @gzdecode($data) ?: $data; } - return $profile; + if (!$data = unserialize($data)) { + return null; + } + + return $this->createProfileFromData($token, $data, $profile); } } From 53aa7cf03143f990a47de18157d312d3bd66c11b Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 31 Aug 2022 10:56:54 +0200 Subject: [PATCH 037/106] [HttpKernel] fix merge --- Controller/ArgumentResolver/DateTimeValueResolver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/ArgumentResolver/DateTimeValueResolver.php b/Controller/ArgumentResolver/DateTimeValueResolver.php index 55007bef7b..d8953f564b 100644 --- a/Controller/ArgumentResolver/DateTimeValueResolver.php +++ b/Controller/ArgumentResolver/DateTimeValueResolver.php @@ -65,7 +65,7 @@ public function resolve(Request $request, ArgumentMetadata $argument): iterable if (null !== $format) { $date = $class::createFromFormat($format, $value); - if ($class::getLastErrors()['warning_count']) { + if (($class::getLastErrors() ?: ['warning_count' => 0])['warning_count']) { $date = false; } } else { From ad0cb4fa755331a6379d6b36e41c63147ae7a2e6 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Mon, 5 Sep 2022 16:21:17 +0200 Subject: [PATCH 038/106] Prevent exception if request stack is empty --- DataCollector/RequestDataCollector.php | 2 +- Tests/DataCollector/RequestDataCollectorTest.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/DataCollector/RequestDataCollector.php b/DataCollector/RequestDataCollector.php index 523f5c957f..951860a225 100644 --- a/DataCollector/RequestDataCollector.php +++ b/DataCollector/RequestDataCollector.php @@ -110,7 +110,7 @@ public function collect(Request $request, Response $response, \Throwable $except 'session_metadata' => $sessionMetadata, 'session_attributes' => $sessionAttributes, 'session_usages' => array_values($this->sessionUsages), - 'stateless_check' => $this->requestStack && $this->requestStack->getMainRequest()->attributes->get('_stateless', false), + 'stateless_check' => $this->requestStack && ($mainRequest = $this->requestStack->getMainRequest()) && $mainRequest->attributes->get('_stateless', false), 'flashes' => $flashes, 'path_info' => $request->getPathInfo(), 'controller' => 'n/a', diff --git a/Tests/DataCollector/RequestDataCollectorTest.php b/Tests/DataCollector/RequestDataCollectorTest.php index 0c576e00ed..d7c8b302b6 100644 --- a/Tests/DataCollector/RequestDataCollectorTest.php +++ b/Tests/DataCollector/RequestDataCollectorTest.php @@ -312,6 +312,15 @@ public function testStatelessCheck() $collector->lateCollect(); $this->assertTrue($collector->getStatelessCheck()); + + $requestStack = new RequestStack(); + $request = $this->createRequest(); + + $collector = new RequestDataCollector($requestStack); + $collector->collect($request, $response = $this->createResponse()); + $collector->lateCollect(); + + $this->assertFalse($collector->getStatelessCheck()); } public function testItHidesPassword() From fb0bd60d4e10497a9bed2b33e0474b39a19f93ab Mon Sep 17 00:00:00 2001 From: Mathieu Date: Wed, 21 Sep 2022 09:27:00 +0200 Subject: [PATCH 039/106] Fix LocaleListenerTest Accept-Language headers --- Tests/EventListener/LocaleListenerTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/EventListener/LocaleListenerTest.php b/Tests/EventListener/LocaleListenerTest.php index 4c1c624de2..824d906340 100644 --- a/Tests/EventListener/LocaleListenerTest.php +++ b/Tests/EventListener/LocaleListenerTest.php @@ -120,7 +120,7 @@ public function testRequestLocaleIsNotOverridden() public function testRequestPreferredLocaleFromAcceptLanguageHeader() { $request = Request::create('/'); - $request->headers->set('Accept-Language', ['Accept-Language: fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5']); + $request->headers->set('Accept-Language', 'fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5'); $listener = new LocaleListener($this->requestStack, 'de', null, true, ['de', 'fr']); $event = $this->getEvent($request); @@ -133,7 +133,7 @@ public function testRequestPreferredLocaleFromAcceptLanguageHeader() public function testRequestSecondPreferredLocaleFromAcceptLanguageHeader() { $request = Request::create('/'); - $request->headers->set('Accept-Language', ['Accept-Language: fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5']); + $request->headers->set('Accept-Language', 'fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5'); $listener = new LocaleListener($this->requestStack, 'de', null, true, ['de', 'en']); $event = $this->getEvent($request); @@ -146,7 +146,7 @@ public function testRequestSecondPreferredLocaleFromAcceptLanguageHeader() public function testDontUseAcceptLanguageHeaderIfNotEnabled() { $request = Request::create('/'); - $request->headers->set('Accept-Language', ['Accept-Language: fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5']); + $request->headers->set('Accept-Language', 'fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5'); $listener = new LocaleListener($this->requestStack, 'de', null, false, ['de', 'en']); $event = $this->getEvent($request); @@ -159,7 +159,7 @@ public function testDontUseAcceptLanguageHeaderIfNotEnabled() public function testRequestUnavailablePreferredLocaleFromAcceptLanguageHeader() { $request = Request::create('/'); - $request->headers->set('Accept-Language', ['Accept-Language: fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5']); + $request->headers->set('Accept-Language', 'fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5'); $listener = new LocaleListener($this->requestStack, 'de', null, true, ['de', 'it']); $event = $this->getEvent($request); @@ -172,7 +172,7 @@ public function testRequestUnavailablePreferredLocaleFromAcceptLanguageHeader() public function testRequestNoLocaleFromAcceptLanguageHeader() { $request = Request::create('/'); - $request->headers->set('Accept-Language', ['Accept-Language: fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5']); + $request->headers->set('Accept-Language', 'fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5'); $listener = new LocaleListener($this->requestStack, 'de', null, true); $event = $this->getEvent($request); @@ -186,7 +186,7 @@ public function testRequestAttributeLocaleNotOverridenFromAcceptLanguageHeader() { $request = Request::create('/'); $request->attributes->set('_locale', 'it'); - $request->headers->set('Accept-Language', ['Accept-Language: fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5']); + $request->headers->set('Accept-Language', 'fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5'); $listener = new LocaleListener($this->requestStack, 'de', null, true, ['fr', 'en']); $event = $this->getEvent($request); From 115a7bbc449ffd846572df7a117b97d766ee9402 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Fri, 23 Sep 2022 16:33:10 +0200 Subject: [PATCH 040/106] [HttpKernel] Use Accept-Language header even if there are no enabled locales --- EventListener/LocaleListener.php | 6 ++++-- Tests/EventListener/LocaleListenerTest.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/EventListener/LocaleListener.php b/EventListener/LocaleListener.php index ede5e7f88b..2502fa4be9 100644 --- a/EventListener/LocaleListener.php +++ b/EventListener/LocaleListener.php @@ -68,8 +68,10 @@ private function setLocale(Request $request) { if ($locale = $request->attributes->get('_locale')) { $request->setLocale($locale); - } elseif ($this->useAcceptLanguageHeader && $this->enabledLocales && ($preferredLanguage = $request->getPreferredLanguage($this->enabledLocales))) { - $request->setLocale($preferredLanguage); + } elseif ($this->useAcceptLanguageHeader) { + if ($preferredLanguage = $request->getPreferredLanguage($this->enabledLocales)) { + $request->setLocale($preferredLanguage); + } $request->attributes->set('_vary_by_language', true); } } diff --git a/Tests/EventListener/LocaleListenerTest.php b/Tests/EventListener/LocaleListenerTest.php index 824d906340..63e5f4bd18 100644 --- a/Tests/EventListener/LocaleListenerTest.php +++ b/Tests/EventListener/LocaleListenerTest.php @@ -179,7 +179,7 @@ public function testRequestNoLocaleFromAcceptLanguageHeader() $listener->setDefaultLocale($event); $listener->onKernelRequest($event); - $this->assertEquals('de', $request->getLocale()); + $this->assertEquals('fr_FR', $request->getLocale()); } public function testRequestAttributeLocaleNotOverridenFromAcceptLanguageHeader() From fb72bc54f300151fadef84fce79764138b1ef943 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 30 Sep 2022 09:27:59 +0200 Subject: [PATCH 041/106] Update VERSION for 4.4.46 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 09c0f68162..c6476b615d 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.46-DEV'; + public const VERSION = '4.4.46'; public const VERSION_ID = 40446; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 46; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From 253b181271d9345963ba02185362b7cbe6527637 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 30 Sep 2022 09:39:45 +0200 Subject: [PATCH 042/106] Bump Symfony version to 4.4.47 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index c6476b615d..8133c320cd 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.46'; - public const VERSION_ID = 40446; + public const VERSION = '4.4.47-DEV'; + public const VERSION_ID = 40447; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 46; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 47; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From 4f25330c216b7bb178603b2e25fb7a9325015507 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 30 Sep 2022 09:40:28 +0200 Subject: [PATCH 043/106] Update VERSION for 5.4.13 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 7a7e678a4f..93068eda13 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.13-DEV'; + public const VERSION = '5.4.13'; public const VERSION_ID = 50413; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 13; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 44218cabab6c6887231e6b92d3d81b683bae186b Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 30 Sep 2022 10:03:03 +0200 Subject: [PATCH 044/106] Bump Symfony version to 5.4.14 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 93068eda13..6e20f90721 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.13'; - public const VERSION_ID = 50413; + public const VERSION = '5.4.14-DEV'; + public const VERSION_ID = 50414; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 13; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 14; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 5939a039103580d8d86a4c80e245258ad50c91b2 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 30 Sep 2022 10:03:37 +0200 Subject: [PATCH 045/106] Update VERSION for 6.0.13 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index eb53328f2c..9bddd8202f 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.13-DEV'; + public const VERSION = '6.0.13'; public const VERSION_ID = 60013; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; public const RELEASE_VERSION = 13; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From f1b9eab86c9b747cf4f1ec27817f1e5389a78095 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 30 Sep 2022 10:10:11 +0200 Subject: [PATCH 046/106] Bump Symfony version to 6.0.14 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 9bddd8202f..29da5629cf 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.13'; - public const VERSION_ID = 60013; + public const VERSION = '6.0.14-DEV'; + public const VERSION_ID = 60014; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; - public const RELEASE_VERSION = 13; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 14; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From bf433ef30c2dfbf1f47449d5dce8be243e8a0012 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 30 Sep 2022 10:10:57 +0200 Subject: [PATCH 047/106] Update VERSION for 6.1.5 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 69d906ccd6..67145a2ed7 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.5-DEV'; + public const VERSION = '6.1.5'; public const VERSION_ID = 60105; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; public const RELEASE_VERSION = 5; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 9da43a53bd53156def5bcecd8ae974a111e04779 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 30 Sep 2022 10:16:45 +0200 Subject: [PATCH 048/106] Bump Symfony version to 6.1.6 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 67145a2ed7..8b757fcd51 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.5'; - public const VERSION_ID = 60105; + public const VERSION = '6.1.6-DEV'; + public const VERSION_ID = 60106; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; - public const RELEASE_VERSION = 5; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 6; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From bc58e5408d72b0d8af2e11ef569e26e7001a42fa Mon Sep 17 00:00:00 2001 From: Andrii Dembitskyi Date: Fri, 30 Sep 2022 10:59:54 +0300 Subject: [PATCH 049/106] [FrameworkBundle] Allow to specify `null` for exception mapping configuration values --- EventListener/ErrorListener.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/EventListener/ErrorListener.php b/EventListener/ErrorListener.php index 9dc3871c25..b6fd0a357d 100644 --- a/EventListener/ErrorListener.php +++ b/EventListener/ErrorListener.php @@ -33,8 +33,14 @@ class ErrorListener implements EventSubscriberInterface protected $controller; protected $logger; protected $debug; + /** + * @var array|null}> + */ protected $exceptionsMapping; + /** + * @param array|null}> $exceptionsMapping + */ public function __construct($controller, LoggerInterface $logger = null, bool $debug = false, array $exceptionsMapping = []) { $this->controller = $controller; From 91cf5dbc9ea4d902470e596246a736179acfb79d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 12 Oct 2022 09:05:45 +0200 Subject: [PATCH 050/106] Update VERSION for 4.4.47 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 8133c320cd..f944b3d9e6 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.47-DEV'; + public const VERSION = '4.4.47'; public const VERSION_ID = 40447; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 47; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From d84ce93ce38b50926cb14416fbdeea88ab8e5729 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 12 Oct 2022 09:11:51 +0200 Subject: [PATCH 051/106] Bump Symfony version to 4.4.48 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index f944b3d9e6..13636cc09f 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.47'; - public const VERSION_ID = 40447; + public const VERSION = '4.4.48-DEV'; + public const VERSION_ID = 40448; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 47; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 48; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From 6f77fabc1a37c2dceecc6f78cca44772705dc52f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 12 Oct 2022 09:12:21 +0200 Subject: [PATCH 052/106] Update VERSION for 5.4.14 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 6e20f90721..25370cef3f 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.14-DEV'; + public const VERSION = '5.4.14'; public const VERSION_ID = 50414; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 14; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 28fbba690fc2be08c966715b9e04fdc83ab67e4a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 12 Oct 2022 09:43:05 +0200 Subject: [PATCH 053/106] Bump Symfony version to 5.4.15 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 25370cef3f..700f16d3ce 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.14'; - public const VERSION_ID = 50414; + public const VERSION = '5.4.15-DEV'; + public const VERSION_ID = 50415; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 14; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 15; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From f9fc93c4f12e2fd7dea37f7b5840deb34e9037fc Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 12 Oct 2022 09:43:45 +0200 Subject: [PATCH 054/106] Update VERSION for 6.0.14 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 29da5629cf..ff528028c0 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.14-DEV'; + public const VERSION = '6.0.14'; public const VERSION_ID = 60014; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; public const RELEASE_VERSION = 14; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From e5a23b5e88a2a21cc9f82d149ab57705243a958f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 12 Oct 2022 09:48:13 +0200 Subject: [PATCH 055/106] Bump Symfony version to 6.0.15 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index ff528028c0..111cefd0f2 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.14'; - public const VERSION_ID = 60014; + public const VERSION = '6.0.15-DEV'; + public const VERSION_ID = 60015; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; - public const RELEASE_VERSION = 14; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 15; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 102f99bf81799e93f61b9a73b2f38b309c587a94 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 12 Oct 2022 09:48:47 +0200 Subject: [PATCH 056/106] Update VERSION for 6.1.6 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 8b757fcd51..3c8c4068dc 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.6-DEV'; + public const VERSION = '6.1.6'; public const VERSION_ID = 60106; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; public const RELEASE_VERSION = 6; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 97759f4370311c3b2a0172750df09db96309d3f0 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 12 Oct 2022 09:54:12 +0200 Subject: [PATCH 057/106] Bump Symfony version to 6.1.7 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 3c8c4068dc..fa83f540d9 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.6'; - public const VERSION_ID = 60106; + public const VERSION = '6.1.7-DEV'; + public const VERSION_ID = 60107; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; - public const RELEASE_VERSION = 6; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 7; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From abc13578a29babe39da78eb78923f49d29286305 Mon Sep 17 00:00:00 2001 From: cyve Date: Sun, 16 Oct 2022 18:02:26 +0200 Subject: [PATCH 058/106] [HttpKernel] Remove EOL when using error_log() in HttpKernel Logger --- Log/Logger.php | 18 +++++++++++------- Tests/Log/LoggerTest.php | 24 ++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/Log/Logger.php b/Log/Logger.php index 3e1db33466..1238517f64 100644 --- a/Log/Logger.php +++ b/Log/Logger.php @@ -44,10 +44,14 @@ public function __construct(string $minLevel = null, $output = null, callable $f if (isset($_ENV['SHELL_VERBOSITY']) || isset($_SERVER['SHELL_VERBOSITY'])) { switch ((int) ($_ENV['SHELL_VERBOSITY'] ?? $_SERVER['SHELL_VERBOSITY'])) { - case -1: $minLevel = LogLevel::ERROR; break; - case 1: $minLevel = LogLevel::NOTICE; break; - case 2: $minLevel = LogLevel::INFO; break; - case 3: $minLevel = LogLevel::DEBUG; break; + case -1: $minLevel = LogLevel::ERROR; + break; + case 1: $minLevel = LogLevel::NOTICE; + break; + case 2: $minLevel = LogLevel::INFO; + break; + case 3: $minLevel = LogLevel::DEBUG; + break; } } } @@ -80,7 +84,7 @@ public function log($level, $message, array $context = []) $formatter = $this->formatter; if ($this->handle) { - @fwrite($this->handle, $formatter($level, $message, $context)); + @fwrite($this->handle, $formatter($level, $message, $context).\PHP_EOL); } else { error_log($formatter($level, $message, $context, false)); } @@ -91,7 +95,7 @@ private function format(string $level, string $message, array $context, bool $pr if (str_contains($message, '{')) { $replacements = []; foreach ($context as $key => $val) { - if (null === $val || is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) { + if (null === $val || \is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) { $replacements["{{$key}}"] = $val; } elseif ($val instanceof \DateTimeInterface) { $replacements["{{$key}}"] = $val->format(\DateTime::RFC3339); @@ -105,7 +109,7 @@ private function format(string $level, string $message, array $context, bool $pr $message = strtr($message, $replacements); } - $log = sprintf('[%s] %s', $level, $message).\PHP_EOL; + $log = sprintf('[%s] %s', $level, $message); if ($prefixDate) { $log = date(\DateTime::RFC3339).' '.$log; } diff --git a/Tests/Log/LoggerTest.php b/Tests/Log/LoggerTest.php index fb2b43cc82..5996e6e72a 100644 --- a/Tests/Log/LoggerTest.php +++ b/Tests/Log/LoggerTest.php @@ -48,7 +48,7 @@ protected function tearDown(): void public static function assertLogsMatch(array $expected, array $given) { foreach ($given as $k => $line) { - self::assertThat(1 === preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[\+-][0-9]{2}:[0-9]{2} '.preg_quote($expected[$k]).'/', $line), self::isTrue(), "\"$line\" do not match expected pattern \"$expected[$k]\""); + self::assertSame(1, preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[\+-][0-9]{2}:[0-9]{2} '.preg_quote($expected[$k]).'/', $line), "\"$line\" do not match expected pattern \"$expected[$k]\""); } } @@ -186,7 +186,7 @@ public function testContextExceptionKeyCanBeExceptionOrOtherValues() public function testFormatter() { $this->logger = new Logger(LogLevel::DEBUG, $this->tmpFile, function ($level, $message, $context) { - return json_encode(['level' => $level, 'message' => $message, 'context' => $context]).\PHP_EOL; + return json_encode(['level' => $level, 'message' => $message, 'context' => $context]); }); $this->logger->error('An error', ['foo' => 'bar']); @@ -196,6 +196,26 @@ public function testFormatter() '{"level":"warning","message":"A warning","context":{"baz":"bar"}}', ], $this->getLogs()); } + + public function testLogsWithoutOutput() + { + $oldErrorLog = ini_set('error_log', $this->tmpFile); + + $logger = new Logger(); + $logger->error('test'); + $logger->critical('test'); + + $expected = [ + '[error] test', + '[critical] test', + ]; + + foreach ($this->getLogs() as $k => $line) { + $this->assertSame(1, preg_match('/\[[\w\/\-: ]+\] '.preg_quote($expected[$k]).'/', $line), "\"$line\" do not match expected pattern \"$expected[$k]\""); + } + + ini_set('error_log', $oldErrorLog); + } } class DummyTest From 3f611709a785bebe25aa124a22b46747e38e0b21 Mon Sep 17 00:00:00 2001 From: Krzysztof Pyrkosz Date: Thu, 13 Oct 2022 17:34:04 +0200 Subject: [PATCH 059/106] [HttpKernel] Fix empty request stack when terminating with exception --- HttpKernel.php | 12 +++++++++++- Tests/HttpKernelTest.php | 17 +++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/HttpKernel.php b/HttpKernel.php index d53b80665b..e23023d3c4 100644 --- a/HttpKernel.php +++ b/HttpKernel.php @@ -112,7 +112,17 @@ public function terminateWithException(\Throwable $exception, Request $request = throw $exception; } - $response = $this->handleThrowable($exception, $request, self::MASTER_REQUEST); + if ($pop = $request !== $this->requestStack->getMasterRequest()) { + $this->requestStack->push($request); + } + + try { + $response = $this->handleThrowable($exception, $request, self::MASTER_REQUEST); + } finally { + if ($pop) { + $this->requestStack->pop(); + } + } $response->sendHeaders(); $response->sendContent(); diff --git a/Tests/HttpKernelTest.php b/Tests/HttpKernelTest.php index 53e5f547d2..a163715f81 100644 --- a/Tests/HttpKernelTest.php +++ b/Tests/HttpKernelTest.php @@ -20,6 +20,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface; use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; +use Symfony\Component\HttpKernel\Event\ExceptionEvent; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\ControllerDoesNotReturnResponseException; @@ -340,6 +341,22 @@ public function testTerminate() $this->assertEquals($response, $capturedResponse); } + public function testTerminateWithException() + { + $dispatcher = new EventDispatcher(); + $requestStack = new RequestStack(); + $kernel = $this->getHttpKernel($dispatcher, null, $requestStack); + + $dispatcher->addListener(KernelEvents::EXCEPTION, function (ExceptionEvent $event) use (&$capturedRequest, $requestStack) { + $capturedRequest = $requestStack->getCurrentRequest(); + $event->setResponse(new Response()); + }); + + $kernel->terminateWithException(new \Exception('boo'), $request = Request::create('/')); + $this->assertSame($request, $capturedRequest); + $this->assertNull($requestStack->getCurrentRequest()); + } + public function testVerifyRequestStackPushPopDuringHandle() { $request = new Request(); From 7dc3aac73bc0fbccdc69f3f5d68adaf17a344f2d Mon Sep 17 00:00:00 2001 From: "Phil E. Taylor" Date: Thu, 27 Oct 2022 08:55:40 +0100 Subject: [PATCH 060/106] Typos In Comments --- Tests/HttpCache/HttpCacheTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/HttpCache/HttpCacheTest.php b/Tests/HttpCache/HttpCacheTest.php index cef30fad05..7d8ef79187 100644 --- a/Tests/HttpCache/HttpCacheTest.php +++ b/Tests/HttpCache/HttpCacheTest.php @@ -590,7 +590,7 @@ public function testDegradationWhenCacheLocked() $this->cacheConfig['stale_while_revalidate'] = 10; - // The prescence of Last-Modified makes this cacheable (because Response::isValidateable() then). + // The presence of Last-Modified makes this cacheable (because Response::isValidateable() then). $this->setNextResponse(200, ['Cache-Control' => 'public, s-maxage=5', 'Last-Modified' => 'some while ago'], 'Old response'); $this->request('GET', '/'); // warm the cache From a6d5229dd9466e046674baad8449ad92ee24eddd Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 18:49:22 +0200 Subject: [PATCH 061/106] Update VERSION for 4.4.48 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 13636cc09f..54ea465379 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.48-DEV'; + public const VERSION = '4.4.48'; public const VERSION_ID = 40448; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 48; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From 0924172f04193fc4123ee6e473984438f6d2eb5a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 19:50:38 +0200 Subject: [PATCH 062/106] Bump Symfony version to 4.4.49 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 54ea465379..ce28585fe1 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.48'; - public const VERSION_ID = 40448; + public const VERSION = '4.4.49-DEV'; + public const VERSION_ID = 40449; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 48; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 49; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From fc63c8c3e1036d424820cc993a4ea163778dc5c7 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 19:52:18 +0200 Subject: [PATCH 063/106] Update VERSION for 5.4.15 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 700f16d3ce..ee902ea21c 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.15-DEV'; + public const VERSION = '5.4.15'; public const VERSION_ID = 50415; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 15; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 3fb0dd9d9acd588e6b0dd756ce526c35398e958a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 19:59:25 +0200 Subject: [PATCH 064/106] Bump Symfony version to 5.4.16 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index ee902ea21c..7b47f6812b 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.15'; - public const VERSION_ID = 50415; + public const VERSION = '5.4.16-DEV'; + public const VERSION_ID = 50416; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 15; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 16; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 22c820abe601e7328b56cec86626617139266f48 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 20:00:40 +0200 Subject: [PATCH 065/106] Update VERSION for 6.0.15 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 111cefd0f2..c59e058e28 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.15-DEV'; + public const VERSION = '6.0.15'; public const VERSION_ID = 60015; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; public const RELEASE_VERSION = 15; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From e71b52c96c2a044f7d1666dc4c801af40eb8e836 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 20:04:55 +0200 Subject: [PATCH 066/106] Bump Symfony version to 6.0.16 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index c59e058e28..c9b6213279 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.15'; - public const VERSION_ID = 60015; + public const VERSION = '6.0.16-DEV'; + public const VERSION_ID = 60016; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; - public const RELEASE_VERSION = 15; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 16; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 8fc1ffe753948c47a103a809cdd6a4a8458b3254 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 20:06:36 +0200 Subject: [PATCH 067/106] Update VERSION for 6.1.7 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index fa83f540d9..78193d31c6 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.7-DEV'; + public const VERSION = '6.1.7'; public const VERSION_ID = 60107; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; public const RELEASE_VERSION = 7; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 629a7a50f6ce0cd5cc757943aefbb53c65f86c93 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 20:19:50 +0200 Subject: [PATCH 068/106] Bump Symfony version to 6.1.8 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 78193d31c6..67e42aa891 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.7'; - public const VERSION_ID = 60107; + public const VERSION = '6.1.8-DEV'; + public const VERSION_ID = 60108; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; - public const RELEASE_VERSION = 7; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 8; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From c5907faca59447ad1458a40fdc758f53f93eab78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Fri, 4 Nov 2022 13:00:28 +0100 Subject: [PATCH 069/106] Fix deprecation notice when date argument is not nullable and null value is provided --- .../DateTimeValueResolver.php | 4 +--- .../DateTimeValueResolverTest.php | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Controller/ArgumentResolver/DateTimeValueResolver.php b/Controller/ArgumentResolver/DateTimeValueResolver.php index d8953f564b..e9a7494a4c 100644 --- a/Controller/ArgumentResolver/DateTimeValueResolver.php +++ b/Controller/ArgumentResolver/DateTimeValueResolver.php @@ -60,8 +60,6 @@ public function resolve(Request $request, ArgumentMetadata $argument): iterable $format = $attribute->format; } - $date = false; - if (null !== $format) { $date = $class::createFromFormat($format, $value); @@ -73,7 +71,7 @@ public function resolve(Request $request, ArgumentMetadata $argument): iterable $value = '@'.$value; } try { - $date = new $class($value); + $date = new $class($value ?? 'now'); } catch (\Exception) { $date = false; } diff --git a/Tests/Controller/ArgumentResolver/DateTimeValueResolverTest.php b/Tests/Controller/ArgumentResolver/DateTimeValueResolverTest.php index e1c3d662c6..b438c527a3 100644 --- a/Tests/Controller/ArgumentResolver/DateTimeValueResolverTest.php +++ b/Tests/Controller/ArgumentResolver/DateTimeValueResolverTest.php @@ -113,6 +113,26 @@ public function testNullableWithEmptyAttribute() $this->assertNull($results[0]); } + /** + * @dataProvider getTimeZones + */ + public function testNow(string $timezone) + { + date_default_timezone_set($timezone); + $resolver = new DateTimeValueResolver(); + + $argument = new ArgumentMetadata('dummy', \DateTime::class, false, false, null, false); + $request = self::requestWithAttributes(['dummy' => null]); + + /** @var \Generator $results */ + $results = $resolver->resolve($request, $argument); + $results = iterator_to_array($results); + + $this->assertCount(1, $results); + $this->assertEquals('0', $results[0]->diff(new \DateTimeImmutable())->format('%s')); + $this->assertSame($timezone, $results[0]->getTimezone()->getName(), 'Default timezone'); + } + public function testPreviouslyConvertedAttribute() { $resolver = new DateTimeValueResolver(); From 541739241846ad93b18f73cffeb239c987d1b62c Mon Sep 17 00:00:00 2001 From: MatTheCat Date: Wed, 9 Nov 2022 12:01:14 +0100 Subject: [PATCH 070/106] =?UTF-8?q?[HttpKernel]=20Don=E2=80=99t=20try=20to?= =?UTF-8?q?=20wire=20Response=20argument=20with=20controller.service=5Farg?= =?UTF-8?q?uments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...RegisterControllerArgumentLocatorsPass.php | 3 ++- ...sterControllerArgumentLocatorsPassTest.php | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/DependencyInjection/RegisterControllerArgumentLocatorsPass.php b/DependencyInjection/RegisterControllerArgumentLocatorsPass.php index 8fd1f553e0..3dbaff5641 100644 --- a/DependencyInjection/RegisterControllerArgumentLocatorsPass.php +++ b/DependencyInjection/RegisterControllerArgumentLocatorsPass.php @@ -24,6 +24,7 @@ use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\TypedReference; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Session\SessionInterface; /** @@ -174,7 +175,7 @@ public function process(ContainerBuilder $container) $invalidBehavior = ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE; } - if (Request::class === $type || SessionInterface::class === $type) { + if (Request::class === $type || SessionInterface::class === $type || Response::class === $type) { continue; } diff --git a/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php b/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php index 1e3d25d440..a8fdd7975b 100644 --- a/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php +++ b/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php @@ -23,6 +23,7 @@ use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\ServiceLocator; use Symfony\Component\DependencyInjection\TypedReference; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\DependencyInjection\RegisterControllerArgumentLocatorsPass; use Symfony\Component\HttpKernel\Tests\Fixtures\Suit; @@ -447,6 +448,20 @@ public function testBindWithTarget() ]; $this->assertEquals($expected, $locator->getArgument(0)); } + + public function testResponseArgumentIsIgnored() + { + $container = new ContainerBuilder(); + $resolver = $container->register('argument_resolver.service', 'stdClass')->addArgument([]); + + $container->register('foo', WithResponseArgument::class) + ->addTag('controller.service_arguments'); + + (new RegisterControllerArgumentLocatorsPass())->process($container); + + $locator = $container->getDefinition((string) $resolver->getArgument(0))->getArgument(0); + $this->assertEmpty(array_keys($locator), 'Response typed argument is ignored'); + } } class RegisterTestController @@ -527,3 +542,10 @@ public function fooAction( ) { } } + +class WithResponseArgument +{ + public function fooAction(Response $response, ?Response $nullableResponse) + { + } +} From bc62d956382ffbb9e1de5c5ef20fcebec2a1545a Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Mon, 21 Nov 2022 18:37:52 +0100 Subject: [PATCH 071/106] [HttpKernel] Fix message for unresovable arguments of invokable controllers --- .../NotTaggedControllerValueResolver.php | 5 +++-- .../NotTaggedControllerValueResolverTest.php | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php b/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php index d4971cc1a5..48ea6e742d 100644 --- a/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php +++ b/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php @@ -69,8 +69,9 @@ public function resolve(Request $request, ArgumentMetadata $argument): iterable } if (!$this->container->has($controller)) { - $i = strrpos($controller, ':'); - $controller = substr($controller, 0, $i).strtolower(substr($controller, $i)); + $controller = (false !== $i = strrpos($controller, ':')) + ? substr($controller, 0, $i).strtolower(substr($controller, $i)) + : $controller.'::__invoke'; } $what = sprintf('argument $%s of "%s()"', $argument->getName(), $controller); diff --git a/Tests/Controller/ArgumentResolver/NotTaggedControllerValueResolverTest.php b/Tests/Controller/ArgumentResolver/NotTaggedControllerValueResolverTest.php index 3cf2f0f185..4577b5a6d2 100644 --- a/Tests/Controller/ArgumentResolver/NotTaggedControllerValueResolverTest.php +++ b/Tests/Controller/ArgumentResolver/NotTaggedControllerValueResolverTest.php @@ -98,6 +98,17 @@ public function testControllerNameIsAnArray() $resolver->resolve($request, $argument); } + public function testInvokableController() + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('Could not resolve argument $dummy of "App\Controller\Mine::__invoke()", maybe you forgot to register the controller as a service or missed tagging it with the "controller.service_arguments"?'); + $resolver = new NotTaggedControllerValueResolver(new ServiceLocator([])); + $argument = new ArgumentMetadata('dummy', \stdClass::class, false, false, null); + $request = $this->requestWithAttributes(['_controller' => 'App\Controller\Mine']); + $this->assertTrue($resolver->supports($request, $argument)); + $resolver->resolve($request, $argument); + } + private function requestWithAttributes(array $attributes) { $request = Request::create('/'); From 0b2134a255237c6d856324ff777742de1eee702c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Sat, 26 Nov 2022 21:37:00 +0100 Subject: [PATCH 072/106] Convert previously defined date attribute to the expected class --- .../DateTimeValueResolver.php | 4 +-- .../DateTimeValueResolverTest.php | 25 ++++++++++++++----- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Controller/ArgumentResolver/DateTimeValueResolver.php b/Controller/ArgumentResolver/DateTimeValueResolver.php index e9a7494a4c..f014b5bcb8 100644 --- a/Controller/ArgumentResolver/DateTimeValueResolver.php +++ b/Controller/ArgumentResolver/DateTimeValueResolver.php @@ -39,9 +39,10 @@ public function supports(Request $request, ArgumentMetadata $argument): bool public function resolve(Request $request, ArgumentMetadata $argument): iterable { $value = $request->attributes->get($argument->getName()); + $class = \DateTimeInterface::class === $argument->getType() ? \DateTimeImmutable::class : $argument->getType(); if ($value instanceof \DateTimeInterface) { - yield $value; + yield $value instanceof $class ? $value : $class::createFromInterface($value); return; } @@ -52,7 +53,6 @@ public function resolve(Request $request, ArgumentMetadata $argument): iterable return; } - $class = \DateTimeInterface::class === $argument->getType() ? \DateTimeImmutable::class : $argument->getType(); $format = null; if ($attributes = $argument->getAttributes(MapDateTime::class, ArgumentMetadata::IS_INSTANCEOF)) { diff --git a/Tests/Controller/ArgumentResolver/DateTimeValueResolverTest.php b/Tests/Controller/ArgumentResolver/DateTimeValueResolverTest.php index b438c527a3..ac10dfc1a5 100644 --- a/Tests/Controller/ArgumentResolver/DateTimeValueResolverTest.php +++ b/Tests/Controller/ArgumentResolver/DateTimeValueResolverTest.php @@ -20,7 +20,7 @@ class DateTimeValueResolverTest extends TestCase { - private $defaultTimezone; + private readonly string $defaultTimezone; protected function setUp(): void { @@ -32,13 +32,20 @@ protected function tearDown(): void date_default_timezone_set($this->defaultTimezone); } - public function getTimeZones() + public static function getTimeZones() { yield ['UTC']; yield ['Etc/GMT+9']; yield ['Etc/GMT-14']; } + public static function getClasses() + { + yield [\DateTimeInterface::class]; + yield [\DateTime::class]; + yield [FooDateTime::class]; + } + public function testSupports() { $resolver = new DateTimeValueResolver(); @@ -133,11 +140,16 @@ public function testNow(string $timezone) $this->assertSame($timezone, $results[0]->getTimezone()->getName(), 'Default timezone'); } - public function testPreviouslyConvertedAttribute() + /** + * @param class-string<\DateTimeInterface> $class + * + * @dataProvider getClasses + */ + public function testPreviouslyConvertedAttribute(string $class) { $resolver = new DateTimeValueResolver(); - $argument = new ArgumentMetadata('dummy', \DateTime::class, false, false, null, true); + $argument = new ArgumentMetadata('dummy', $class, false, false, null, true); $request = self::requestWithAttributes(['dummy' => $datetime = new \DateTime()]); /** @var \Generator $results */ @@ -145,7 +157,8 @@ public function testPreviouslyConvertedAttribute() $results = iterator_to_array($results); $this->assertCount(1, $results); - $this->assertSame($datetime, $results[0]); + $this->assertEquals($datetime, $results[0], 'The value is the same, but the class can be modified.'); + $this->assertInstanceOf($class, $results[0]); } public function testCustomClass() @@ -209,7 +222,7 @@ public function testWithFormat(string $timezone) $this->assertEquals('2016-09-08 12:34:56', $results[0]->format('Y-m-d H:i:s')); } - public function provideInvalidDates() + public static function provideInvalidDates() { return [ 'invalid date' => [ From 4e36db8103062c62b3882b1bd297b02de6b021c4 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 28 Nov 2022 18:58:43 +0100 Subject: [PATCH 073/106] Update VERSION for 4.4.49 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index ce28585fe1..be36bc6346 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.49-DEV'; + public const VERSION = '4.4.49'; public const VERSION_ID = 40449; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 49; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From b432c57c5de73634b1859093c1f58e3cd84455a1 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 28 Nov 2022 19:08:58 +0100 Subject: [PATCH 074/106] Update VERSION for 5.4.16 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 7b47f6812b..94735c2f08 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.16-DEV'; + public const VERSION = '5.4.16'; public const VERSION_ID = 50416; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 16; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From a14cb684cf901b775209ac8b49976d93751da3dd Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 28 Nov 2022 19:13:24 +0100 Subject: [PATCH 075/106] Bump Symfony version to 5.4.17 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 94735c2f08..a783462b8c 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.16'; - public const VERSION_ID = 50416; + public const VERSION = '5.4.17-DEV'; + public const VERSION_ID = 50417; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 16; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 17; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 8ba1344821807ad51f230f0d01e0fa8f366e4abb Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 28 Nov 2022 19:15:44 +0100 Subject: [PATCH 076/106] Update VERSION for 6.0.16 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index c9b6213279..c5e600fcb4 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.16-DEV'; + public const VERSION = '6.0.16'; public const VERSION_ID = 60016; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; public const RELEASE_VERSION = 16; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 4567f7fe0ac0c7ab4f53bb87563c788c9e16279e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 28 Nov 2022 19:20:31 +0100 Subject: [PATCH 077/106] Bump Symfony version to 6.0.17 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index c5e600fcb4..25b69d132d 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.16'; - public const VERSION_ID = 60016; + public const VERSION = '6.0.17-DEV'; + public const VERSION_ID = 60017; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; - public const RELEASE_VERSION = 16; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 17; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 6073eaed148f4c0b8d4ae33e7332b34327ef728e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 28 Nov 2022 19:20:59 +0100 Subject: [PATCH 078/106] Update VERSION for 6.1.8 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 67e42aa891..f279be7534 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.8-DEV'; + public const VERSION = '6.1.8'; public const VERSION_ID = 60108; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; public const RELEASE_VERSION = 8; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From ae3cd18b77c3a6b34d28e33b8c54c45fa7e3a96b Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 28 Nov 2022 19:25:32 +0100 Subject: [PATCH 079/106] Bump Symfony version to 6.1.9 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index f279be7534..946ca05ad8 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.8'; - public const VERSION_ID = 60108; + public const VERSION = '6.1.9-DEV'; + public const VERSION_ID = 60109; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; - public const RELEASE_VERSION = 8; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 9; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 4fa5825b7133c22145e67820c9ea0b10e6c48506 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 12 Dec 2022 16:54:21 +0100 Subject: [PATCH 080/106] Fix getting the name of closures on PHP 8.1.11+ --- ControllerMetadata/ArgumentMetadataFactory.php | 2 +- DataCollector/RequestDataCollector.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ControllerMetadata/ArgumentMetadataFactory.php b/ControllerMetadata/ArgumentMetadataFactory.php index e3835c057a..85bb805f34 100644 --- a/ControllerMetadata/ArgumentMetadataFactory.php +++ b/ControllerMetadata/ArgumentMetadataFactory.php @@ -33,7 +33,7 @@ public function createArgumentMetadata($controller): array $class = $reflection->class; } else { $reflection = new \ReflectionFunction($controller); - if ($class = str_contains($reflection->name, '{closure}') ? null : $reflection->getClosureScopeClass()) { + if ($class = str_contains($reflection->name, '{closure}') ? null : (\PHP_VERSION_ID >= 80111 ? $reflection->getClosureCalledClass() : $reflection->getClosureScopeClass())) { $class = $class->name; } } diff --git a/DataCollector/RequestDataCollector.php b/DataCollector/RequestDataCollector.php index 951860a225..5717000f29 100644 --- a/DataCollector/RequestDataCollector.php +++ b/DataCollector/RequestDataCollector.php @@ -479,7 +479,7 @@ private function parseController($controller) } $controller['method'] = $r->name; - if ($class = $r->getClosureScopeClass()) { + if ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { $controller['class'] = $class->name; } else { return $r->name; From e524d2873a774dd97ad1a99484ff0f60bab254ff Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 13 Dec 2022 10:30:20 +0100 Subject: [PATCH 081/106] [HttpKernel][ErrorHandler] Fix reading the SYMFONY_IDE env var --- Debug/FileLinkFormatter.php | 3 ++- phpunit.xml.dist | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Debug/FileLinkFormatter.php b/Debug/FileLinkFormatter.php index 0944652741..4eaeeb1513 100644 --- a/Debug/FileLinkFormatter.php +++ b/Debug/FileLinkFormatter.php @@ -35,7 +35,8 @@ class FileLinkFormatter */ public function __construct(string|array $fileLinkFormat = null, RequestStack $requestStack = null, string $baseDir = null, string|\Closure $urlFormat = null) { - $fileLinkFormat ??= $_SERVER['SYMFONY_IDE'] ?? ''; + $fileLinkFormat ??= $_ENV['SYMFONY_IDE'] ?? $_SERVER['SYMFONY_IDE'] ?? ''; + if (!\is_array($fileLinkFormat) && $fileLinkFormat = (ErrorRendererInterface::IDE_LINK_FORMATS[$fileLinkFormat] ?? $fileLinkFormat) ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: false) { $i = strpos($f = $fileLinkFormat, '&', max(strrpos($f, '%f'), strrpos($f, '%l'))) ?: \strlen($f); $fileLinkFormat = [substr($f, 0, $i)] + preg_split('/&([^>]++)>/', substr($f, $i), -1, \PREG_SPLIT_DELIM_CAPTURE); diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7e2c738f86..a72dcbcca2 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -10,6 +10,7 @@ > + From 2a919968dfa24d995960d6ee96a69ccf3f79ba9b Mon Sep 17 00:00:00 2001 From: rodmen Date: Tue, 13 Dec 2022 16:36:51 -0300 Subject: [PATCH 082/106] [HttpKernel] AbstractSessionListener should not override the cache lifetime for private responses --- EventListener/AbstractSessionListener.php | 5 +- Tests/EventListener/SessionListenerTest.php | 59 +++++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/EventListener/AbstractSessionListener.php b/EventListener/AbstractSessionListener.php index 4603052e93..27749b24b2 100644 --- a/EventListener/AbstractSessionListener.php +++ b/EventListener/AbstractSessionListener.php @@ -200,10 +200,11 @@ public function onKernelResponse(ResponseEvent $event) } if ($autoCacheControl) { + $maxAge = $response->headers->hasCacheControlDirective('public') ? 0 : (int) $response->getMaxAge(); $response - ->setExpires(new \DateTime()) + ->setExpires(new \DateTimeImmutable('+'.$maxAge.' seconds')) ->setPrivate() - ->setMaxAge(0) + ->setMaxAge($maxAge) ->headers->addCacheControlDirective('must-revalidate'); } diff --git a/Tests/EventListener/SessionListenerTest.php b/Tests/EventListener/SessionListenerTest.php index 5e11875bb1..96f66354ba 100644 --- a/Tests/EventListener/SessionListenerTest.php +++ b/Tests/EventListener/SessionListenerTest.php @@ -39,6 +39,7 @@ class SessionListenerTest extends TestCase { /** * @dataProvider provideSessionOptions + * * @runInSeparateProcess */ public function testSessionCookieOptions(array $phpSessionOptions, array $sessionOptions, array $expectedSessionOptions) @@ -531,6 +532,64 @@ public function testUninitializedSessionWithoutInitializedSession() $this->assertSame('60', $response->headers->getCacheControlDirective('s-maxage')); } + public function testResponseHeadersMaxAgeAndExpiresNotBeOverridenIfSessionStarted() + { + $session = $this->createMock(Session::class); + $session->expects($this->exactly(2))->method('getUsageIndex')->will($this->onConsecutiveCalls(0, 1)); + + $container = new Container(); + $container->set('initialized_session', $session); + + $listener = new SessionListener($container); + $kernel = $this->createMock(HttpKernelInterface::class); + + $request = new Request(); + $listener->onKernelRequest(new RequestEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST)); + + $response = new Response(); + $response->setPrivate(); + $expiresHeader = gmdate('D, d M Y H:i:s', time() + 600).' GMT'; + $response->setMaxAge(600); + $listener->onKernelResponse(new ResponseEvent($kernel, new Request(), HttpKernelInterface::MAIN_REQUEST, $response)); + + $this->assertTrue($response->headers->has('expires')); + $this->assertSame($expiresHeader, $response->headers->get('expires')); + $this->assertFalse($response->headers->has('max-age')); + $this->assertSame('600', $response->headers->getCacheControlDirective('max-age')); + $this->assertFalse($response->headers->hasCacheControlDirective('public')); + $this->assertTrue($response->headers->hasCacheControlDirective('private')); + $this->assertTrue($response->headers->hasCacheControlDirective('must-revalidate')); + $this->assertFalse($response->headers->has(AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER)); + } + + public function testResponseHeadersMaxAgeAndExpiresDefaultValuesIfSessionStarted() + { + $session = $this->createMock(Session::class); + $session->expects($this->exactly(2))->method('getUsageIndex')->will($this->onConsecutiveCalls(0, 1)); + + $container = new Container(); + $container->set('initialized_session', $session); + + $listener = new SessionListener($container); + $kernel = $this->createMock(HttpKernelInterface::class); + + $request = new Request(); + $listener->onKernelRequest(new RequestEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST)); + + $response = new Response(); + $expiresHeader = gmdate('D, d M Y H:i:s', time()).' GMT'; + $listener->onKernelResponse(new ResponseEvent($kernel, new Request(), HttpKernelInterface::MAIN_REQUEST, $response)); + + $this->assertTrue($response->headers->has('expires')); + $this->assertSame($expiresHeader, $response->headers->get('expires')); + $this->assertFalse($response->headers->has('max-age')); + $this->assertSame('0', $response->headers->getCacheControlDirective('max-age')); + $this->assertFalse($response->headers->hasCacheControlDirective('public')); + $this->assertTrue($response->headers->hasCacheControlDirective('private')); + $this->assertTrue($response->headers->hasCacheControlDirective('must-revalidate')); + $this->assertFalse($response->headers->has(AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER)); + } + public function testSurrogateMainRequestIsPublic() { $session = $this->createMock(Session::class); From 5529d2912e011b08ed112d8d3e5b1bfade6e250e Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 16 Dec 2022 15:48:25 +0100 Subject: [PATCH 083/106] [HttpKernel] fix merge --- Tests/EventListener/SessionListenerTest.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Tests/EventListener/SessionListenerTest.php b/Tests/EventListener/SessionListenerTest.php index be1eaee13f..719c4bc107 100644 --- a/Tests/EventListener/SessionListenerTest.php +++ b/Tests/EventListener/SessionListenerTest.php @@ -560,10 +560,13 @@ public function testUninitializedSessionWithoutInitializedSession() public function testResponseHeadersMaxAgeAndExpiresNotBeOverridenIfSessionStarted() { $session = $this->createMock(Session::class); - $session->expects($this->exactly(2))->method('getUsageIndex')->will($this->onConsecutiveCalls(0, 1)); + $session->expects($this->once())->method('getUsageIndex')->willReturn(1); + $session->expects($this->once())->method('getName')->willReturn('foo'); + $sessionFactory = $this->createMock(SessionFactory::class); + $sessionFactory->expects($this->once())->method('createSession')->willReturn($session); $container = new Container(); - $container->set('initialized_session', $session); + $container->set('session_factory', $sessionFactory); $listener = new SessionListener($container); $kernel = $this->createMock(HttpKernelInterface::class); @@ -571,11 +574,13 @@ public function testResponseHeadersMaxAgeAndExpiresNotBeOverridenIfSessionStarte $request = new Request(); $listener->onKernelRequest(new RequestEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST)); + $request->getSession(); + $response = new Response(); $response->setPrivate(); $expiresHeader = gmdate('D, d M Y H:i:s', time() + 600).' GMT'; $response->setMaxAge(600); - $listener->onKernelResponse(new ResponseEvent($kernel, new Request(), HttpKernelInterface::MAIN_REQUEST, $response)); + $listener->onKernelResponse(new ResponseEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST, $response)); $this->assertTrue($response->headers->has('expires')); $this->assertSame($expiresHeader, $response->headers->get('expires')); @@ -590,20 +595,20 @@ public function testResponseHeadersMaxAgeAndExpiresNotBeOverridenIfSessionStarte public function testResponseHeadersMaxAgeAndExpiresDefaultValuesIfSessionStarted() { $session = $this->createMock(Session::class); - $session->expects($this->exactly(2))->method('getUsageIndex')->will($this->onConsecutiveCalls(0, 1)); + $session->expects($this->once())->method('getUsageIndex')->willReturn(1); $container = new Container(); - $container->set('initialized_session', $session); $listener = new SessionListener($container); $kernel = $this->createMock(HttpKernelInterface::class); $request = new Request(); + $request->setSession($session); $listener->onKernelRequest(new RequestEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST)); $response = new Response(); $expiresHeader = gmdate('D, d M Y H:i:s', time()).' GMT'; - $listener->onKernelResponse(new ResponseEvent($kernel, new Request(), HttpKernelInterface::MAIN_REQUEST, $response)); + $listener->onKernelResponse(new ResponseEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST, $response)); $this->assertTrue($response->headers->has('expires')); $this->assertSame($expiresHeader, $response->headers->get('expires')); From 5b0af9ddc416e45388662a36f0f9fb66636b7b77 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 16 Dec 2022 16:06:54 +0100 Subject: [PATCH 084/106] [HttpKernel] fix merge --- .../RegisterControllerArgumentLocatorsPassTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php b/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php index 302f9e35dd..d6be9d3bd0 100644 --- a/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php +++ b/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php @@ -467,7 +467,7 @@ public function testAutowireAttribute() $container = new ContainerBuilder(); $resolver = $container->register('argument_resolver.service', 'stdClass')->addArgument([]); - $container->register('some.id', \stdClass::class); + $container->register('some.id', \stdClass::class)->setPublic(true); $container->setParameter('some.parameter', 'foo'); $container->register('foo', WithAutowireAttribute::class) From c50126588a0d9b4236b062605e2eda85f36df9b9 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 19 Dec 2022 15:31:05 +0100 Subject: [PATCH 085/106] Fix using SYMFONY_IDE in tests --- Tests/Debug/FileLinkFormatterTest.php | 8 ++++++++ phpunit.xml.dist | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Tests/Debug/FileLinkFormatterTest.php b/Tests/Debug/FileLinkFormatterTest.php index d24958c6c5..57605c1ae4 100644 --- a/Tests/Debug/FileLinkFormatterTest.php +++ b/Tests/Debug/FileLinkFormatterTest.php @@ -27,9 +27,17 @@ public function testWhenNoFileLinkFormatAndNoRequest() public function testAfterUnserialize() { + $ide = $_ENV['SYMFONY_IDE'] ?? $_SERVER['SYMFONY_IDE'] ?? null; + $_ENV['SYMFONY_IDE'] = $_SERVER['SYMFONY_IDE'] = null; $sut = unserialize(serialize(new FileLinkFormatter())); $this->assertFalse($sut->format('/kernel/root/src/my/very/best/file.php', 3)); + + if (null === $ide) { + unset($_ENV['SYMFONY_IDE'], $_SERVER['SYMFONY_IDE']); + } else { + $_ENV['SYMFONY_IDE'] = $_SERVER['SYMFONY_IDE'] = $ide; + } } public function testWhenFileLinkFormatAndNoRequest() diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a72dcbcca2..7e2c738f86 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -10,7 +10,6 @@ > - From 7e38b847a23f986c29b3366684c42ff9de18cb1d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 28 Dec 2022 15:51:55 +0100 Subject: [PATCH 086/106] Update VERSION for 5.4.17 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index a783462b8c..b7d516e413 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.17-DEV'; + public const VERSION = '5.4.17'; public const VERSION_ID = 50417; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 17; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 6dd61cf667c06fb8c18ce02ecca2dfd0301ce11b Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 28 Dec 2022 15:55:17 +0100 Subject: [PATCH 087/106] Bump Symfony version to 5.4.18 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index b7d516e413..75244b851e 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.17'; - public const VERSION_ID = 50417; + public const VERSION = '5.4.18-DEV'; + public const VERSION_ID = 50418; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 17; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 18; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From ce1a8d268d9bc32b806f3afa33e157b1df79214c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 28 Dec 2022 15:55:51 +0100 Subject: [PATCH 088/106] Update VERSION for 6.0.17 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 25b69d132d..34ebae503a 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.17-DEV'; + public const VERSION = '6.0.17'; public const VERSION_ID = 60017; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; public const RELEASE_VERSION = 17; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 7410c8d2568ecec305de90003ef4166be202e37f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 28 Dec 2022 16:00:15 +0100 Subject: [PATCH 089/106] Bump Symfony version to 6.0.18 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 34ebae503a..246b5eb57d 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.17'; - public const VERSION_ID = 60017; + public const VERSION = '6.0.18-DEV'; + public const VERSION_ID = 60018; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; - public const RELEASE_VERSION = 17; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 18; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From d47bb75aaceed29e82917c0c9b1dc805bfc9bd05 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 28 Dec 2022 16:00:40 +0100 Subject: [PATCH 090/106] Update VERSION for 6.1.9 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 946ca05ad8..22efec0525 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.9-DEV'; + public const VERSION = '6.1.9'; public const VERSION_ID = 60109; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; public const RELEASE_VERSION = 9; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From fb752c35aa3a2c05a9badf9bfe662c326b10b37f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 28 Dec 2022 16:05:17 +0100 Subject: [PATCH 091/106] Bump Symfony version to 6.1.10 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 22efec0525..ae8df3c5a0 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.9'; - public const VERSION_ID = 60109; + public const VERSION = '6.1.10-DEV'; + public const VERSION_ID = 60110; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; - public const RELEASE_VERSION = 9; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 10; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 5da6f57a13e5d7d77197443cf55697cdf65f1352 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 29 Dec 2022 19:54:08 +0100 Subject: [PATCH 092/106] Update VERSION for 5.4.18 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 75244b851e..62af9c6acc 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.18-DEV'; + public const VERSION = '5.4.18'; public const VERSION_ID = 50418; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 18; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 816ab5cf0d1247abefd0a0da922c1dd6aea2a78a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 29 Dec 2022 19:57:48 +0100 Subject: [PATCH 093/106] Bump Symfony version to 5.4.19 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 62af9c6acc..8f12b88e81 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.18'; - public const VERSION_ID = 50418; + public const VERSION = '5.4.19-DEV'; + public const VERSION_ID = 50419; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 18; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 19; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 71b52f9e5740b124894b454244fa0db48bb15814 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 29 Dec 2022 19:58:12 +0100 Subject: [PATCH 094/106] Update VERSION for 6.0.18 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 246b5eb57d..27467f7714 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.18-DEV'; + public const VERSION = '6.0.18'; public const VERSION_ID = 60018; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; public const RELEASE_VERSION = 18; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 35eb3f7cffd4d7e2891263e2a1c6839cbb8113d4 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 29 Dec 2022 20:01:21 +0100 Subject: [PATCH 095/106] Bump Symfony version to 6.0.19 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 27467f7714..2d08c05a85 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.18'; - public const VERSION_ID = 60018; + public const VERSION = '6.0.19-DEV'; + public const VERSION_ID = 60019; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; - public const RELEASE_VERSION = 18; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 19; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 8aa5a91d563ef368800bd41758096a6291844de1 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 29 Dec 2022 20:01:43 +0100 Subject: [PATCH 096/106] Update VERSION for 6.1.10 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index ae8df3c5a0..28e24fad87 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.10-DEV'; + public const VERSION = '6.1.10'; public const VERSION_ID = 60110; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; public const RELEASE_VERSION = 10; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From bb80056b85ca35b319801c6cac6627bef3ae3614 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 29 Dec 2022 20:04:43 +0100 Subject: [PATCH 097/106] Bump Symfony version to 6.1.11 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 28e24fad87..e9a423af64 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.10'; - public const VERSION_ID = 60110; + public const VERSION = '6.1.11-DEV'; + public const VERSION_ID = 60111; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; - public const RELEASE_VERSION = 10; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 11; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 519658daef172cfb3a5cc5b78ce5eb0fb0ff3691 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 1 Jan 2023 09:32:19 +0100 Subject: [PATCH 098/106] Bump license year to 2023 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 88bf75bb4d..0083704572 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2022 Fabien Potencier +Copyright (c) 2004-2023 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From c4b9839f82d317f125194b020510cb7e7517dd7a Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Sat, 14 Jan 2023 17:44:03 +0100 Subject: [PATCH 099/106] [Tests] Remove `$this` occurrences in future static data providers --- Tests/EventListener/ErrorListenerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/EventListener/ErrorListenerTest.php b/Tests/EventListener/ErrorListenerTest.php index 00a6bde900..73cc19afc8 100644 --- a/Tests/EventListener/ErrorListenerTest.php +++ b/Tests/EventListener/ErrorListenerTest.php @@ -209,7 +209,7 @@ public function controllerProvider() }]; yield [function ($exception) { - $this->assertInstanceOf(FlattenException::class, $exception); + static::assertInstanceOf(FlattenException::class, $exception); return new Response('OK: '.$exception->getMessage()); }]; From ee371cd7718c938d1bffdf868b665003aeeae69c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 24 Jan 2023 14:37:42 +0100 Subject: [PATCH 100/106] Update VERSION for 5.4.19 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 8f12b88e81..d354205eb1 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.19-DEV'; + public const VERSION = '5.4.19'; public const VERSION_ID = 50419; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 19; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 441e106d6026b86a9e7cb0e645a0b3c038899742 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 24 Jan 2023 14:41:59 +0100 Subject: [PATCH 101/106] Bump Symfony version to 5.4.20 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index d354205eb1..3126ebd31a 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.19'; - public const VERSION_ID = 50419; + public const VERSION = '5.4.20-DEV'; + public const VERSION_ID = 50420; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 19; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 20; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From 0a01b69b46b1be6d3c252307c8d683de56d4541f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 24 Jan 2023 14:42:21 +0100 Subject: [PATCH 102/106] Update VERSION for 6.0.19 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 2d08c05a85..a874adba56 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.19-DEV'; + public const VERSION = '6.0.19'; public const VERSION_ID = 60019; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; public const RELEASE_VERSION = 19; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From d8a773b418385226ab715aa6d61f54e0e94a2c5f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 24 Jan 2023 16:21:34 +0100 Subject: [PATCH 103/106] Bump Symfony version to 6.0.20 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index a874adba56..075bb8aa3c 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.19'; - public const VERSION_ID = 60019; + public const VERSION = '6.0.20-DEV'; + public const VERSION_ID = 60020; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; - public const RELEASE_VERSION = 19; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 20; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 949057183c1d1c142d8bc356a25317077d05b266 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 24 Jan 2023 16:23:56 +0100 Subject: [PATCH 104/106] Update VERSION for 6.1.11 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index e9a423af64..3d4f014dcd 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.11-DEV'; + public const VERSION = '6.1.11'; public const VERSION_ID = 60111; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; public const RELEASE_VERSION = 11; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 17a5e8830cdc3371989215f4e1994d0ab272898d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 24 Jan 2023 16:32:44 +0100 Subject: [PATCH 105/106] Bump Symfony version to 6.1.12 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 3d4f014dcd..b8a1257953 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.11'; - public const VERSION_ID = 60111; + public const VERSION = '6.1.12-DEV'; + public const VERSION_ID = 60112; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; - public const RELEASE_VERSION = 11; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 12; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From 7a4a69dee1b0db04bdc12e86d4cd0dbf6daa390c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 1 Feb 2023 09:26:56 +0100 Subject: [PATCH 106/106] Update VERSION for 6.1.12 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index b8a1257953..8d415b41f5 100644 --- a/Kernel.php +++ b/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.1.12-DEV'; + public const VERSION = '6.1.12'; public const VERSION_ID = 60112; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 1; public const RELEASE_VERSION = 12; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023';