[BC] New Version
This version simplifies the api a lot, eliminating unnecesary complexity and reducing the library to a few classes only.
This commit is contained in:
35
src/InvalidRut.php
Normal file
35
src/InvalidRut.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @project Chilean Rut
|
||||
* @link https://github.com/mnavarrocarter/chilean-rut
|
||||
* @package mnavarrocarter/chilean-rut
|
||||
* @author Matias Navarro-Carter mnavarrocarter@gmail.com
|
||||
* @license MIT
|
||||
* @copyright 2020 Matias Navarro Carter
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace MNC\ChileanRut;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Class InvalidRut.
|
||||
*/
|
||||
class InvalidRut extends InvalidArgumentException
|
||||
{
|
||||
public static function number(): InvalidRut
|
||||
{
|
||||
return new self('Rut number cannot be greater than 999.999.999 and smaller than zero');
|
||||
}
|
||||
|
||||
public static function digit(string $digit): InvalidRut
|
||||
{
|
||||
return new self(sprintf('The verifier digit "%s" is not valid', $digit));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user