Skip to content

doc fix #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ If you pass a filter to `Filter::factory()`, it will be returned unmodified. So

Complex chaining can also be supported. So if you wanted to check if an array with a minimum size of 4, with numeric keys and containing strings of minimum length 5, that could be built like so:

$filter = Filter::array('min:4', 'int', 'string,min:5');
$filter = Filter::arrays('min:4', 'int', 'string,min:5');

If we wanted to validate an associative array, we would use a "map" filter:

Expand All @@ -99,15 +99,15 @@ If we wanted to validate an associative array, we would use a "map" filter:

Filterus also ships with a procedural interface for calling filters.

\Filterus\filter($var, $filter);
\Filterus\filter($filter, $var);

And

\Filterus\validate($var, $filter);
\Filterus\validate($filter, $var);

Any filter is supported (both are basically simple wrappers):

function \Filterus\filter($var, $filter) {
function \Filterus\filter($filter, $var) {
return \Filterus\Filter::factory($filter)->filter($var);
}

Expand Down