Skip to content

Commit 300aaf5

Browse files
Remove all "nullable-by-default-value" setters
1 parent 55fe121 commit 300aaf5

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CHANGELOG
1010
* Add `absolute_uri` option to surrogate fragment renderers
1111
* Add `ValueResolverInterface` and deprecate `ArgumentValueResolverInterface`
1212
* Add argument `$reflector` to `ArgumentResolverInterface` and `ArgumentMetadataFactoryInterface`
13+
* Deprecate calling `ConfigDataCollector::setKernel()`, `RouterListener::setCurrentRequest()` without arguments
1314

1415
6.1
1516
---

DataCollector/ConfigDataCollector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
3131
*/
3232
public function setKernel(KernelInterface $kernel = null)
3333
{
34+
if (1 > \func_num_args()) {
35+
trigger_deprecation('symfony/http-kernel', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
36+
}
37+
3438
$this->kernel = $kernel;
3539
}
3640

EventListener/RouterListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function __construct(UrlMatcherInterface|RequestMatcherInterface $matcher
6868
$this->debug = $debug;
6969
}
7070

71-
private function setCurrentRequest(Request $request = null)
71+
private function setCurrentRequest(?Request $request)
7272
{
7373
if (null !== $request) {
7474
try {

HttpCache/ResponseCacheStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function update(Response $response)
110110
$response->headers->set('Age', $this->age);
111111

112112
if ($this->isNotCacheableResponseEmbedded) {
113-
$response->setLastModified();
113+
$response->setLastModified(null);
114114

115115
if ($this->flagDirectives['no-store']) {
116116
$response->headers->set('Cache-Control', 'no-cache, no-store, must-revalidate');

0 commit comments

Comments
 (0)