Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chenqionghe committed May 7, 2018
1 parent 649c713 commit c3fcf37
Show file tree
Hide file tree
Showing 31 changed files with 132 additions and 132 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
### 快速使用
```
$data = [
'name' => 'CQH',
'name' => 'chenqionghe',
'age' => '十八',
'email' => 'abc',
'money' => "abc",
Expand Down Expand Up @@ -203,7 +203,7 @@ if (!$val->validate()) {
```
#### json(验证json格式)
```
$data = ['json1' => 'abcdef', 'mobile2' => '{"name":"CQH","age":18}'];
$data = ['json1' => 'abcdef', 'mobile2' => '{"name":"chenqionghe","age":18}'];
$val = new Validator($data);
$val->rules([
['json', "json1"],
Expand Down Expand Up @@ -240,7 +240,7 @@ if (!$val->validate()) {
```
#### email(验证邮箱)
```
$data = ['email1' => 'abcdef', 'email2' => 'CQH@sina.com'];
$data = ['email1' => 'abcdef', 'email2' => 'chenqionghe@sina.com'];
$val = new Validator($data);
$val->rules([
['email', "email1"],
Expand Down Expand Up @@ -460,7 +460,7 @@ $data = ['name' => "abc"];
$val = new Validator($data);
$val->rules([
['func', 'name', 'is_array'],
['func', 'name', [\CQH\Utils\Arrays::class, 'isMultidim']],
['func', 'name', [\chenqionghe\Utils\Arrays::class, 'isMultidim']],
]);
if (!$val->validate()) {
var_dump($val->errorString());
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"license": "MIT",
"type": "library",
"require": {
"CQH/utils": "*"
"chenqionghe/utils": "*"
},
"autoload": {
"psr-4": {
"CQH\\Validator\\": "src/"
"chenqionghe\\Validator\\": "src/"
}
},
"minimum-stability": "dev"
Expand Down
4 changes: 2 additions & 2 deletions src/Rule.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace CQH\Validator;
namespace chenqionghe\Validator;

/**
* Interface Rule
* @package CQH\Validator
* @package chenqionghe\Validator
*/
interface Rule
{
Expand Down
32 changes: 16 additions & 16 deletions src/Validator.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<?php

namespace CQH\Validator;
namespace chenqionghe\Validator;

use DateTime;
use ArrayAccess;
use IteratorAggregate;
use JsonSerializable;
use CQH\Utils\ArrayTrait;
use CQH\Utils\Arrays;
use CQH\Utils\Strings;
use CQH\Validator\Rules\AlphaValidator;
use CQH\Validator\Rules\AlphaNumValidator;
use CQH\Validator\Rules\BankCardValidator;
use CQH\Validator\Rules\CarPlateValidator;
use CQH\Validator\Rules\DateValidator;
use CQH\Validator\Rules\EmailValidator;
use CQH\Validator\Rules\IpValidator;
use CQH\Validator\Rules\MobileValidator;
use CQH\Validator\Rules\SlugValidator;
use CQH\Validator\Rules\TelValidator;
use CQH\Validator\Rules\UrlValidator;
use chenqionghe\Utils\ArrayTrait;
use chenqionghe\Utils\Arrays;
use chenqionghe\Utils\Strings;
use chenqionghe\Validator\Rules\AlphaValidator;
use chenqionghe\Validator\Rules\AlphaNumValidator;
use chenqionghe\Validator\Rules\BankCardValidator;
use chenqionghe\Validator\Rules\CarPlateValidator;
use chenqionghe\Validator\Rules\DateValidator;
use chenqionghe\Validator\Rules\EmailValidator;
use chenqionghe\Validator\Rules\IpValidator;
use chenqionghe\Validator\Rules\MobileValidator;
use chenqionghe\Validator\Rules\SlugValidator;
use chenqionghe\Validator\Rules\TelValidator;
use chenqionghe\Validator\Rules\UrlValidator;
use Serializable;
use Countable;

/**
* Class Validator
* @author chenqionghe
* @property $attributes
* @package CQH\Validator
* @package chenqionghe\Validator
* */
class Validator implements ArrayAccess, IteratorAggregate, JsonSerializable, Serializable, Countable
{
Expand Down
8 changes: 4 additions & 4 deletions src/rules/AlphaNumValidator.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace CQH\Validator\Rules;
namespace chenqionghe\Validator\Rules;

use CQH\Validator\Validator;
use CQH\Validator\Rule;
use chenqionghe\Validator\Validator;
use chenqionghe\Validator\Rule;

/**
* Class AlphaNumValidator
* @author chenqionghe
* @package CQH\Validator\Rules
* @package chenqionghe\Validator\Rules
*/
class AlphaNumValidator implements Rule
{
Expand Down
8 changes: 4 additions & 4 deletions src/rules/AlphaValidator.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace CQH\Validator\Rules;
namespace chenqionghe\Validator\Rules;

use CQH\Validator\Validator;
use CQH\Validator\Rule;
use chenqionghe\Validator\Validator;
use chenqionghe\Validator\Rule;

/**
* Class AlphaValidator
* @author chenqionghe
* @package CQH\Validator\Rules
* @package chenqionghe\Validator\Rules
*/
class AlphaValidator implements Rule
{
Expand Down
6 changes: 3 additions & 3 deletions src/rules/BankCardValidator.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace CQH\Validator\Rules;
namespace chenqionghe\Validator\Rules;

use CQH\Validator\Validator;
use CQH\Validator\Rule;
use chenqionghe\Validator\Validator;
use chenqionghe\Validator\Rule;

/**
* Class BankcardValidator
Expand Down
8 changes: 4 additions & 4 deletions src/rules/BoolValidator.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace CQH\Validator\Rules;
namespace chenqionghe\Validator\Rules;

use CQH\Validator\Validator;
use CQH\Validator\Rule;
use chenqionghe\Validator\Validator;
use chenqionghe\Validator\Rule;

/**
* Class BoolValidator
* @author chenqionghe
* @package CQH\Validator\Rules
* @package chenqionghe\Validator\Rules
*/
class BoolValidator implements Rule
{
Expand Down
8 changes: 4 additions & 4 deletions src/rules/CarPlateValidator.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace CQH\Validator\Rules;
namespace chenqionghe\Validator\Rules;

use CQH\Validator\Validator;
use CQH\Validator\Rule;
use chenqionghe\Validator\Validator;
use chenqionghe\Validator\Rule;

/**
* Class CarPlateValidator
* @author chenqionghe
* @package CQH\Validator\Rules
* @package chenqionghe\Validator\Rules
*/
class CarPlateValidator implements Rule
{
Expand Down
8 changes: 4 additions & 4 deletions src/rules/CompareValidator.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace CQH\Validator\Rules;
namespace chenqionghe\Validator\Rules;

use CQH\Validator\Validator;
use CQH\Validator\Rule;
use chenqionghe\Validator\Validator;
use chenqionghe\Validator\Rule;

/**
* Class CompareValidator
* @author chenqionghe
* @package CQH\Validator\Rules
* @package chenqionghe\Validator\Rules
*/
class CompareValidator implements Rule
{
Expand Down
8 changes: 4 additions & 4 deletions src/rules/ContainsValidator.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace CQH\Validator\Rules;
namespace chenqionghe\Validator\Rules;

use CQH\Validator\Validator;
use CQH\Validator\Rule;
use chenqionghe\Validator\Validator;
use chenqionghe\Validator\Rule;

/**
* Class ContainsValidator
* @author chenqionghe
* @package CQH\Validator\Rules
* @package chenqionghe\Validator\Rules
*/
class ContainsValidator implements Rule
{
Expand Down
8 changes: 4 additions & 4 deletions src/rules/DateAfterValidator.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

namespace CQH\Validator\Rules;
namespace chenqionghe\Validator\Rules;

use CQH\Validator\Validator;
use chenqionghe\Validator\Validator;
use DateTime;
use CQH\Validator\Rule;
use chenqionghe\Validator\Rule;

/**
* Class DateAfterValidator
* @author chenqionghe
* @package CQH\Validator\Rules
* @package chenqionghe\Validator\Rules
*/
class DateAfterValidator implements Rule
{
Expand Down
8 changes: 4 additions & 4 deletions src/rules/DateBeforeValidator.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace CQH\Validator\Rules;
use CQH\Validator\Validator;
namespace chenqionghe\Validator\Rules;
use chenqionghe\Validator\Validator;
use DateTime;
use CQH\Validator\Rule;
use chenqionghe\Validator\Rule;

/**
* Class DateBeforeValidator
* @author chenqionghe
* @package CQH\Validator\Rules
* @package chenqionghe\Validator\Rules
*/
class DateBeforeValidator implements Rule
{
Expand Down
8 changes: 4 additions & 4 deletions src/rules/DateValidator.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

namespace CQH\Validator\Rules;
namespace chenqionghe\Validator\Rules;

use CQH\Validator\Validator;
use chenqionghe\Validator\Validator;
use DateTime;
use CQH\Validator\Rule;
use chenqionghe\Validator\Rule;

/**
* Class DateValidator
* @author chenqionghe
* @package CQH\Validator\Rules
* @package chenqionghe\Validator\Rules
*/
class DateValidator implements Rule
{
Expand Down
8 changes: 4 additions & 4 deletions src/rules/DiffValidator.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace CQH\Validator\Rules;
namespace chenqionghe\Validator\Rules;

use CQH\Validator\Validator;
use CQH\Validator\Rule;
use chenqionghe\Validator\Validator;
use chenqionghe\Validator\Rule;

/**
* Class DiffValidator
* @author chenqionghe
* @package CQH\Validator\Rules
* @package chenqionghe\Validator\Rules
*/
class DiffValidator implements Rule
{
Expand Down
8 changes: 4 additions & 4 deletions src/rules/EmailValidator.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace CQH\Validator\Rules;
namespace chenqionghe\Validator\Rules;

use CQH\Validator\Validator;
use CQH\Validator\Rule;
use chenqionghe\Validator\Validator;
use chenqionghe\Validator\Rule;

/**
* Class EmailValidator
* @author chenqionghe
* @package CQH\Validator\Rules
* @package chenqionghe\Validator\Rules
*/
class EmailValidator implements Rule
{
Expand Down
8 changes: 4 additions & 4 deletions src/rules/FuncValidator.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace CQH\Validator\Rules;
namespace chenqionghe\Validator\Rules;

use CQH\Validator\Validator;
use CQH\Validator\Rule;
use chenqionghe\Validator\Validator;
use chenqionghe\Validator\Rule;

/**
* Class FuncValidator
* @author chenqionghe
* @package CQH\Validator\Rules
* @package chenqionghe\Validator\Rules
*/
class FuncValidator implements Rule
{
Expand Down
8 changes: 4 additions & 4 deletions src/rules/InValidator.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace CQH\Validator\Rules;
namespace chenqionghe\Validator\Rules;

use CQH\Validator\Validator;
use CQH\Validator\Rule;
use chenqionghe\Validator\Validator;
use chenqionghe\Validator\Rule;

/**
* Class InValidator
* @author chenqionghe
* @package CQH\Validator\Rules
* @package chenqionghe\Validator\Rules
*/
class InValidator implements Rule
{
Expand Down
8 changes: 4 additions & 4 deletions src/rules/IpValidator.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace CQH\Validator\Rules;
namespace chenqionghe\Validator\Rules;

use CQH\Validator\Validator;
use CQH\Validator\Rule;
use chenqionghe\Validator\Validator;
use chenqionghe\Validator\Rule;

/**
* Class IpValidator
* @author chenqionghe
* @package CQH\Validator\Rules
* @package chenqionghe\Validator\Rules
*/
class IpValidator implements Rule
{
Expand Down
Loading

0 comments on commit c3fcf37

Please sign in to comment.