Skip to content

Commit 60eda52

Browse files
committed
feat: add an simple validate class for quick check data
1 parent d803f77 commit 60eda52

12 files changed

+606
-239
lines changed

src/Exception/ValidateException.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ public static function create(string $field, string $message): self
3232
*
3333
* @param string $field
3434
* @param string $message
35+
* @param int $code
3536
*/
36-
public function __construct(string $field, string $message)
37+
public function __construct(string $field, string $message, int $code = 500)
3738
{
38-
parent::__construct($field . ' ' . $message, 500);
39+
parent::__construct("'$field' $message", $code);
3940

4041
// save field
4142
$this->field = $field;

src/Simple/VData.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Inhere\Validate\Simple;
4+
5+
/**
6+
* class VData
7+
*
8+
* @package Inhere\Validate\Simple
9+
*/
10+
class VData extends ValidData
11+
{
12+
13+
}

0 commit comments

Comments
 (0)