[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:
2020-11-20 11:51:33 +00:00
parent 0ad94c4944
commit b4f4fe25b9
32 changed files with 847 additions and 1061 deletions

35
src/InvalidRut.php Normal file
View 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));
}
}