Skip to content

Commit

Permalink
馃摎 Do not append none existing item #16
Browse files Browse the repository at this point in the history
  • Loading branch information
elie29 committed Jul 11, 2019
1 parent 1df3530 commit 53d88dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file, in reverse

### Added

- Nothing.
- [#16](https://github.com/elie29/validator/issues/16) Do not append none existing item.

### Changed

Expand Down
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -121,6 +121,14 @@ class MyValueRule extends AbstractRule
}
```

## Validated Context

Once validate is called, we can use validatedContext method in order to retrieve all validated values from the original
context.

By default, all keys set in the rules array will be found in the validatedContext array. However, if we don't want to append
non existing keys, we should call appendExistingItemsOnly(true) before validation.

## Assertion Integration

Instead of using assertion key by key, you can validate the whole context and than use [Assertion](https://github.com/beberlei/assert) or [Assert](https://github.com/webmozart/assert) as follow:
Expand Down

0 comments on commit 53d88dc

Please sign in to comment.