Skip to content

Commit

Permalink
feat: add an simple validate class for quick check data
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Sep 8, 2021
1 parent d803f77 commit 60eda52
Show file tree
Hide file tree
Showing 12 changed files with 606 additions and 239 deletions.
5 changes: 3 additions & 2 deletions src/Exception/ValidateException.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ public static function create(string $field, string $message): self
*
* @param string $field
* @param string $message
* @param int $code
*/
public function __construct(string $field, string $message)
public function __construct(string $field, string $message, int $code = 500)
{
parent::__construct($field . ' ' . $message, 500);
parent::__construct("'$field' $message", $code);

// save field
$this->field = $field;
Expand Down
13 changes: 13 additions & 0 deletions src/Simple/VData.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php declare(strict_types=1);

namespace Inhere\Validate\Simple;

/**
* class VData
*
* @package Inhere\Validate\Simple
*/
class VData extends ValidData
{

}
Loading

0 comments on commit 60eda52

Please sign in to comment.