Review main Merged

68658[FEATURE] Add AbstractValidator::addErrorForProperty()

Volker Diels-Grabsch CR +2 V +2 Normal +56 −0 updated 05/27/21, 19:30

Commit message

For complex validators, it often makes sense that a custom validator
can attribute an error to a specific property or sub property, even
though it is validating a whole class.

This is already possible by accessing a validator's $this->result
directly, but that is cumbersome and in no way obvious, as this
requires deep knowledge of the Result and Error classes.

So this commit adds a convenience method addErrorForProperty() similar
to addError() that takes a property path in addition to the error
details.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 2

Files 2