Skip to content

Commit 16288f8

Browse files
Remove all "nullable-by-default-value" setters
1 parent bc318c9 commit 16288f8

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
6.2
5+
---
6+
7+
* Deprecate calling `PropertyAccessorBuilder::setCacheItemPool()` without arguments
8+
49
6.0
510
---
611

PropertyAccessorBuilder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ public function isExceptionOnInvalidPropertyPath(): bool
241241
*/
242242
public function setCacheItemPool(CacheItemPoolInterface $cacheItemPool = null): static
243243
{
244+
if (1 > \func_num_args()) {
245+
trigger_deprecation('symfony/property-access', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
246+
}
244247
$this->cacheItemPool = $cacheItemPool;
245248

246249
return $this;

Tests/Fixtures/TestClass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function setPublicAccessor($value)
4949
$this->publicAccessor = $value;
5050
}
5151

52-
public function setPublicAccessorWithDefaultValue($value = null)
52+
public function setPublicAccessorWithDefaultValue($value)
5353
{
5454
$this->publicAccessorWithDefaultValue = $value;
5555
}

0 commit comments

Comments
 (0)