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
This commit is contained in:
commit
788eb4f0bb
@ -103,7 +103,7 @@
|
|||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2",
|
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2",
|
||||||
"phpdocumentor/type-resolver": "<0.2.0",
|
"phpdocumentor/type-resolver": "<0.2.1",
|
||||||
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
|
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
|
||||||
},
|
},
|
||||||
"provide": {
|
"provide": {
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"phpdocumentor/reflection-docblock": "<3.0",
|
"phpdocumentor/reflection-docblock": "<3.0",
|
||||||
"phpdocumentor/type-resolver": "<0.2.0",
|
"phpdocumentor/type-resolver": "<0.2.1",
|
||||||
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
|
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
|
||||||
"symfony/asset": "<3.3",
|
"symfony/asset": "<3.3",
|
||||||
"symfony/console": "<3.3",
|
"symfony/console": "<3.3",
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2",
|
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2",
|
||||||
"phpdocumentor/type-resolver": "<0.2.0",
|
"phpdocumentor/type-resolver": "<0.2.1",
|
||||||
"symfony/dependency-injection": "<3.3"
|
"symfony/dependency-injection": "<3.3"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
"phpdocumentor/reflection-docblock": "^3.0|^4.0"
|
"phpdocumentor/reflection-docblock": "^3.0|^4.0"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
|
"phpdocumentor/type-resolver": "<0.2.1",
|
||||||
"symfony/dependency-injection": "<3.2",
|
"symfony/dependency-injection": "<3.2",
|
||||||
"symfony/property-access": ">=3.0,<3.0.4|>=2.8,<2.8.4",
|
"symfony/property-access": ">=3.0,<3.0.4|>=2.8,<2.8.4",
|
||||||
"symfony/property-info": "<3.1",
|
"symfony/property-info": "<3.1",
|
||||||
|
@ -261,11 +261,13 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
|||||||
|
|
||||||
if (is_object($objectOrClass)) {
|
if (is_object($objectOrClass)) {
|
||||||
$object = $objectOrClass;
|
$object = $objectOrClass;
|
||||||
|
$class = get_class($object);
|
||||||
$cacheKey = spl_object_hash($objectOrClass);
|
$cacheKey = spl_object_hash($objectOrClass);
|
||||||
$propertyPath = PropertyPath::append($this->defaultPropertyPath, $propertyName);
|
$propertyPath = PropertyPath::append($this->defaultPropertyPath, $propertyName);
|
||||||
} else {
|
} else {
|
||||||
// $objectOrClass contains a class name
|
// $objectOrClass contains a class name
|
||||||
$object = null;
|
$object = null;
|
||||||
|
$class = $objectOrClass;
|
||||||
$cacheKey = null;
|
$cacheKey = null;
|
||||||
$propertyPath = $this->defaultPropertyPath;
|
$propertyPath = $this->defaultPropertyPath;
|
||||||
}
|
}
|
||||||
@ -280,7 +282,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
|||||||
$this->validateGenericNode(
|
$this->validateGenericNode(
|
||||||
$value,
|
$value,
|
||||||
$object,
|
$object,
|
||||||
$cacheKey.':'.get_class($object).':'.$propertyName,
|
$cacheKey.':'.$class.':'.$propertyName,
|
||||||
$propertyMetadata,
|
$propertyMetadata,
|
||||||
$propertyPath,
|
$propertyPath,
|
||||||
$groups,
|
$groups,
|
||||||
|
Reference in New Issue
Block a user