2016-04-04 22:25:27 +02:00
|
|
|
<?php
|
2016-04-04 22:49:54 +02:00
|
|
|
|
|
|
|
declare (strict_types = 1);
|
2016-04-04 22:25:27 +02:00
|
|
|
|
|
|
|
namespace Phpml\Exception;
|
|
|
|
|
|
|
|
class InvalidArgumentException extends \Exception
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @return InvalidArgumentException
|
|
|
|
*/
|
2016-04-04 22:38:51 +02:00
|
|
|
public static function sizeNotMatch()
|
2016-04-04 22:25:27 +02:00
|
|
|
{
|
2016-04-04 22:38:51 +02:00
|
|
|
return new self('Size of given arguments not match');
|
2016-04-04 22:25:27 +02:00
|
|
|
}
|
2016-04-06 22:38:08 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $name
|
|
|
|
*
|
|
|
|
* @return InvalidArgumentException
|
|
|
|
*/
|
|
|
|
public static function percentNotInRange($name)
|
|
|
|
{
|
|
|
|
return new self(sprintf('%s must be between 0.0 and 1.0', $name));
|
|
|
|
}
|
2016-04-04 22:25:27 +02:00
|
|
|
}
|