Skip to content

LegacyValidator doesn't provide B/C for validatePropertyValue #11139

@oleg-andreyev

Description

@oleg-andreyev

In 2.4 we can call validator on property this way:

$errors = $this->validator->validatePropertyValue(
    'My/CustomBundle/Entity/Test',
    'customProperty ',
    $value
);

but in 2.5 validatePropertyValue generates

PHP Warning:  spl_object_hash() expects parameter 1 to be object, string given in /vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php on line 214

caused by $cacheKey = spl_object_hash($object);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions