for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @link https://github.com/phpviet/validation
* @copyright (c) PHP Viet
* @license [MIT](https://opensource.org/licenses/MIT)
*/
namespace PHPViet\Validation\Exceptions;
use Respect\Validation\Exceptions\ValidationException;
* @author Vuong Minh <[email protected]>
* @since 1.0.0
class IpVNException extends ValidationException
{
const STANDARD = 0;
const VERSION = 1;
public static $defaultTemplates = [
self::MODE_DEFAULT => [
self::STANDARD => '{{name}} must be an IP address of Viet Nam',
self::VERSION => '{{name}} must be an IP version {{version}}'
],
self::MODE_NEGATIVE => [
];
public function chooseTemplate()
if (null !== $this->getParam('version')) {
return static::VERSION;
} else {
return static::STANDARD;
}