Validation icon indicating copy to clipboard operation
Validation copied to clipboard

identation of nested errors are wrong in the getFullMessage()

Open silvadanilo opened this issue 6 years ago • 0 comments

try {
        $dict = ['name' => 42, 'year' => 42];

        v::keySet(
            v::key('name', v::stringType()),
            v::key('year', v::intVal()->between(10, 20)->in([12, 14])),
        )->assert($dict);
    } catch (NestedValidationException $e) {
        echo $e->getFullMessage();
    }

Expected

- All of the required rules must pass for { "name": 42, "year": 42 }
  - name must be a string
  - These rules must pass for year
    - year must be less than or equal to 20
    - year must be in { 12, 14 }

Current

- All of the required rules must pass for { "name": 42, "year": 42 }
  - name must be a string
  - These rules must pass for year
    - year must be less than or equal to 20
  - year must be in { 12, 14 }

silvadanilo avatar Jan 12 '20 12:01 silvadanilo