8000 minor #24509 fix PHP 7.2 compatibility (xabbuh) · symfony/symfony@788eb4f · GitHub
[go: up one dir, main page]

Skip to content

Commit 788eb4f

Browse files
committed
minor #24509 fix PHP 7.2 compatibility (xabbuh)
This PR was merged into the 3.3 branch. Discussion ---------- fix PHP 7.2 compatibility | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | * the `phpdocumentor/type-resolver` package was not PHP 7.2 compatible before release 0.2.1 (see see phpDocumentor/TypeResolver@e224fb2) * the validator must not call `get_class()` if no object but a class name was passed to the `validatePropertyValue()` method Commits ------- 2d2022c fix PHP 7.2 compatibility
2 parents 9719fba + 2d2022c commit 788eb4f

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
},
104104
"conflict": {
105105
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2",
106-
"phpdocumentor/type-resolver": "<0.2.0",
106+
"phpdocumentor/type-resolver": "<0.2.1",
107107
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
108108
},
109109
"provide": {

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
},
6262
"conflict": {
6363
"phpdocumentor/reflection-docblock": "<3.0",
64-
"phpdocumentor/type-resolver": "<0.2.0",
64+
"phpdocumentor/type-resolver": "<0.2.1",
6565
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
6666
"symfony/asset": "<3.3",
6767
"symfony/console": "<3.3",

src/Symfony/Component/PropertyInfo/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"conflict": {
3737
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2",
38-
"phpdocumentor/type-resolver": "<0.2.0",
38+
"phpdocumentor/type-resolver": "<0.2.1",
3939
"symfony/dependency-injection": "<3.3"
4040
},
4141
"suggest": {

src/Symfony/Component/Serializer/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"phpdocumentor/reflection-docblock": "^3.0|^4.0"
3232
},
3333
"conflict": {
34+
"phpdocumentor/type-resolver": "<0.2.1",
3435
"symfony/dependency-injection": "<3.2",
3536
"symfony/property-access": ">=3.0,<3.0.4|>=2.8,<2.8.4",
3637
"symfony/property-info": "<3.1",

src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,13 @@ public function validatePropertyValue($objectOrClass, $propertyName, $value, $gr
261261

262262
if (is_object($objectOrClass)) {
263263
$object = $objectOrClass;
264+
$class = get_class($object);
264265
$cacheKey = spl_object_hash($objectOrClass);
265266
$propertyPath = PropertyPath::append($this->defaultPropertyPath, $propertyName);
266267
} else {
267268
// $objectOrClass contains a class name
268269
$object = null;
270+
$class = $objectOrClass;
269271
$cacheKey = null;
270272
$propertyPath = $this->defaultPropertyPath;
271273
}
@@ -280,7 +282,7 @@ public function validatePropertyValue($objectOrClass, $propertyName, $value, $gr
280282
$this->validateGenericNode(
281283
$value,
282284
$object,
283-
$cacheKey.':'.get_class($object).':'.$propertyName,
285+
$cacheKey.':'.$class.':'.$propertyName,
284286
$propertyMetadata,
285287
$propertyPath,
286288
$groups,

0 commit comments

Comments
 (0)
0