m6w6 / ascertain
Simple validator, not doing much harm
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/m6w6/ascertain
This package is auto-updated.
Last update: 2025-10-11 03:26:39 UTC
README
Harmless validation.
$user->assert() ->that("name") ->isNotNothing("a name is required") ->isLen(4, "must be at least 4 characters long") ->that("email") ->isEmail("is not valid") ->that("homepage") ->when($user->hasHomepage()) ->isUrl("seems not to be a valid URL"); # ... class User implements \ascertain\Testable { use \ascertain\Validator; protected $id; protected $name; protected $email; protected $homepage; function hasHomepage() { return isset($this->homepage); } function export() { return array( "name" => $this->name, "email" => $this->email, "homepage" => $this->homepage. ); } }