Skip to content

validateProperty notice if no constraint is defined #11604

Closed
@EmmanuelVella

Description

@EmmanuelVella

Calling validateProperty on a property which has no constraint defined will result in a notice, when using the 2.5 or 2.5-bc validation API version.

Example :

class Foo
{
    private $bar;

    public function getBar()
    {
        return $this->bar;
    }
} 

$validator->validateProperty($foo, 'bar'); // Undefined index: bar

You can clone my fork and run phpunit to reproduce it : https://github.com/EmmanuelVella/symfony-standard/commit/73565d4a72270be78117ee7c4b71a11865d637c7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions