Skip to content

Commit cf8f78f

Browse files
[7.0] Remove remaining deprecated code paths
1 parent 7045e68 commit cf8f78f

File tree

4 files changed

+3
-13
lines changed

4 files changed

+3
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
---
66

77
* Add method `isNullSafe()` to `PropertyPathInterface`
8+
* Require explicit argument when calling `PropertyAccessorBuilder::setCacheItemPool()`
89

910
6.3
1011
---

PropertyAccessor.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,7 @@ private function readPropertiesUntil(array $zval, PropertyPathInterface $propert
290290
for ($i = 0; $i < $lastIndex; ++$i) {
291291
$property = $propertyPath->getElement($i);
292292
$isIndex = $propertyPath->isIndex($i);
293-
294-
$isNullSafe = false;
295-
if (method_exists($propertyPath, 'isNullSafe')) {
296-
// To be removed in symfony 7 once we are sure isNullSafe is always implemented.
297-
$isNullSafe = $propertyPath->isNullSafe($i);
298-
} else {
299-
trigger_deprecation('symfony/property-access', '6.2', 'The "%s()" method in class "%s" needs to be implemented in version 7.0, not defining it is deprecated.', 'isNullSafe', PropertyPathInterface::class);
300-
}
293+
$isNullSafe = $propertyPath->isNullSafe($i);
301294

302295
if ($isIndex) {
303296
// Create missing nested arrays on demand

PropertyAccessorBuilder.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,8 @@ public function isExceptionOnInvalidPropertyPath(): bool
239239
*
240240
* @return $this
241241
*/
242-
public function setCacheItemPool(CacheItemPoolInterface $cacheItemPool = null): static
242+
public function setCacheItemPool(?CacheItemPoolInterface $cacheItemPool): 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-
}
247244
$this->cacheItemPool = $cacheItemPool;
248245

249246
return $this;

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
],
1818
"require": {
1919
"php": ">=8.2",
20-
"symfony/deprecation-contracts": "^2.5|^3",
2120
"symfony/property-info": "^6.4|^7.0"
2221
},
2322
"require-dev": {

0 commit comments

Comments
 (0)