Skip to content

Commit

Permalink
[UPD] replace builin option resolver to external option resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
bim-g committed Jul 25, 2023
1 parent 0947d8d commit 27cb48e
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 274 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
}
},
"require": {
"php": ">=7.4"
"php": ">=7.4",
"wepesi/optionsresolver": "^0.2.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand Down
49 changes: 47 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions example/string.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"new_password" => $schema->string()->min(3)->max(40)->match("password")->generate(),
"email" => $schema->string()->min(3)->max(40)->email()->generate(),
"link" => $schema->string()->min(3)->max(40)->url()->generate(),
"ip" => $schema->string()->addressIp()->max(40)->url()->generate(),

"ip" => $schema->string()->addressIp()->generate()
];
$validate->check($source, $rules);
//// check if the validation passed or not
Expand Down
6 changes: 4 additions & 2 deletions example/vardump.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
* Copyright (c) 2023. Wepesi validation.
* @author Boss Ibrahim Mussa
*/
var_dump(["passed"=>$validate->passed()]);
var_dump(["errors"=>$validate->errors()]);
var_dump([
'passed' => $validate->passed(),
'errors' => $validate->errors()
]);
12 changes: 1 addition & 11 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,4 @@
use Wepesi\App\Validator\StringValidator;

require_once __DIR__."/vendor/autoload.php";
//include __DIR__.'/example/index.php';
try {
$stringValidationSourceDataException = new StringValidator('');
} catch (Exception $ex) {
$className = get_class($ex);
$msg = $ex->getMessage();
$code = $ex->getCode();
var_dump($className,
$msg,
$code);
}
include __DIR__.'/example/index.php';
104 changes: 0 additions & 104 deletions src/Resolver/Option.php

This file was deleted.

135 changes: 0 additions & 135 deletions src/Resolver/OptionsResolver.php

This file was deleted.

Loading

0 comments on commit 27cb48e

Please sign in to comment.