PATH:
home
/
lab2454c
/
costbloc.com
/
vendor
/
maba
/
math
<?php namespace Maba\Component\Math; use Maba\Component\Math\Exception\InvalidNumberException; class NumberValidator implements NumberValidatorInterface { public function validateNumber($number) { if (!is_scalar($number)) { throw new InvalidNumberException( sprintf('Given number is not scalar %s', is_object($number) ? get_class($number) : gettype($number)) ); } if (!preg_match('/^-?\d+(\.\d+)?$/', $number)) { throw new InvalidNumberException(sprintf('Invalid number %s', $number)); } } }
[-] composer.json
[edit]
[-] MathInterface.php
[edit]
[-] NumberValidatorInterface.php
[edit]
[-] NumberValidator.php
[edit]
[+]
..
[+]
Exception
[+]
Tests
[-] phpunit.xml.dist
[edit]
[-] .gitignore
[edit]
[-] NumberFormatterInterface.php
[edit]
[-] NumberFormatter.php
[edit]
[-] BasicMathInterface.php
[edit]
[-] BcMath.php
[edit]
[-] .travis.yml
[edit]
[-] Math.php
[edit]
[-] README.md
[edit]
[-] LICENSE
[edit]