Skip to content

Commit ccc5be1

Browse files
Added exceptions
1 parent 7f7ff95 commit ccc5be1

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

src/Exceptions/IdVNException.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* @link https://github.com/phpviet/validation
4+
* @copyright (c) PHP Viet
5+
* @license [MIT](https://opensource.org/licenses/MIT)
6+
*/
7+
8+
namespace PHPViet\Validation\Exceptions;
9+
10+
use Respect\Validation\Exceptions\ValidationException;
11+
12+
/**
13+
* @author Vuong Minh <vuongxuongminh@gmail.com>
14+
* @since 1.0.0
15+
*/
16+
class IdVNException extends ValidationException
17+
{
18+
19+
public static $defaultTemplates = [
20+
self::MODE_DEFAULT => [
21+
self::STANDARD => '{{name}} must be a valid Viet Nam id number',
22+
],
23+
self::MODE_NEGATIVE => [
24+
self::STANDARD => '{{name}} must be a valid Viet Nam id number',
25+
],
26+
];
27+
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* @link https://github.com/phpviet/validation
4+
* @copyright (c) PHP Viet
5+
* @license [MIT](https://opensource.org/licenses/MIT)
6+
*/
7+
8+
namespace PHPViet\Validation\Exceptions;
9+
10+
use Respect\Validation\Exceptions\ValidationException;
11+
12+
/**
13+
* @author Vuong Minh <vuongxuongminh@gmail.com>
14+
* @since 1.0.0
15+
*/
16+
class LandLineVNException extends ValidationException
17+
{
18+
19+
public static $defaultTemplates = [
20+
self::MODE_DEFAULT => [
21+
self::STANDARD => '{{name}} must be a valid Viet Nam land line phone number',
22+
],
23+
self::MODE_NEGATIVE => [
24+
self::STANDARD => '{{name}} must be a valid Viet Nam land line phone number',
25+
],
26+
];
27+
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* @link https://github.com/phpviet/validation
4+
* @copyright (c) PHP Viet
5+
* @license [MIT](https://opensource.org/licenses/MIT)
6+
*/
7+
8+
namespace PHPViet\Validation\Exceptions;
9+
10+
use Respect\Validation\Exceptions\ValidationException;
11+
12+
/**
13+
* @author Vuong Minh <vuongxuongminh@gmail.com>
14+
* @since 1.0.0
15+
*/
16+
class MobileVNException extends ValidationException
17+
{
18+
19+
public static $defaultTemplates = [
20+
self::MODE_DEFAULT => [
21+
self::STANDARD => '{{name}} must be a valid Viet Nam mobile phone number',
22+
],
23+
self::MODE_NEGATIVE => [
24+
self::STANDARD => '{{name}} must be a valid Viet Nam mobile phone number',
25+
],
26+
];
27+
28+
}

0 commit comments

Comments
 (0)