Skip to content
Pieter Hordijk edited this page Dec 31, 2018 · 1 revision

TOC

Blacklist

Validates the input (mixed) to not be in the blacklist (mixed, ...mixed).

Version information

Available since: 1.0.0

Usage

<?php declare(strict_types);

use HarmonyIO\Validation\Rule\In\Blacklist;

(new Blacklist('foo', 'bar', 'baz'))->validate('qux');

Failure reasons

  • In.Blacklist when the validated value is in the blacklist

Whitelist

Validates the input (mixed) to be in the whitelist (mixed, ...mixed).

Version information

Available since: 1.0.0

Usage

<?php declare(strict_types);

use HarmonyIO\Validation\Rule\In\Whitelist;

(new Whitelist('foo', 'bar', 'baz'))->validate('bar');

Failure reasons

  • In.Whitelist when the validated value is not in the whitelist
Clone this wiki locally