Skip to content
This repository was archived by the owner on Apr 20, 2021. It is now read-only.

Commit 9ed02c4

Browse files
authored
Merge pull request #1 from deguif/fix-property-acccessor-deprecations
Fix Symfony >= 5.2 deprecations
2 parents e17f527 + 211518c commit 9ed02c4

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/Json/JsonInspector.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,17 @@ class JsonInspector
1313

1414
public function __construct($evaluationMode)
1515
{
16+
$magicMethods = defined(PropertyAccessor::class.'::DISALLOW_MAGIC_METHODS')
17+
? PropertyAccessor::MAGIC_GET | PropertyAccessor::MAGIC_SET
18+
: false
19+
;
20+
$throwException = defined(PropertyAccessor::class.'::DO_NOT_THROW')
21+
? PropertyAccessor::THROW_ON_INVALID_INDEX | PropertyAccessor::THROW_ON_INVALID_PROPERTY_PATH
22+
: true
23+
;
24+
1625
$this->evaluationMode = $evaluationMode;
17-
$this->accessor = new PropertyAccessor(false, true);
26+
$this->accessor = new PropertyAccessor($magicMethods, $throwException);
1827
}
1928

2029
public function evaluate(Json $json, $expression)

0 commit comments

Comments
 (0)