for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @link https://github.com/ko-ko-ko/php-assert
* @copyright Copyright (c) 2015 Roman Levishchenko <[email protected]>
* @license https://raw.github.com/ko-ko-ko/php-assert/master/LICENSE
*/
namespace KoKoKo\assert\exceptions;
class InvalidDigitException extends ArgumentException
{
* @param string $variableName
* @param string $variableValue
* @throws InvalidStringException
public function __construct($variableName, $variableValue)
if (!is_string($variableName)) {
throw new InvalidStringException('variableName', $variableName);
} elseif (!is_string($variableValue)) {
throw new InvalidStringException('variableValue', $variableValue);
}
parent::__construct(
sprintf(
'Variable "$%s" must be "digit", actual value: "%s"',
$variableName,
$variableValue
)
);