Chris@14: Chris@14: * Chris@14: * For the full copyright and license information, please view the LICENSE Chris@14: * file that was distributed with this source code. Chris@14: */ Chris@14: Chris@14: namespace SebastianBergmann\CodeCoverage; Chris@14: Chris@14: class InvalidArgumentException extends \InvalidArgumentException implements Exception Chris@14: { Chris@14: /** Chris@14: * @param int $argument Chris@14: * @param string $type Chris@14: * @param mixed $value Chris@14: * Chris@14: * @return InvalidArgumentException Chris@14: */ Chris@14: public static function create($argument, $type, $value = null) Chris@14: { Chris@14: $stack = \debug_backtrace(0); Chris@14: Chris@14: return new self( Chris@14: \sprintf( Chris@14: 'Argument #%d%sof %s::%s() must be a %s', Chris@14: $argument, Chris@14: $value !== null ? ' (' . \gettype($value) . '#' . $value . ')' : ' (No Value) ', Chris@14: $stack[1]['class'], Chris@14: $stack[1]['function'], Chris@14: $type Chris@14: ) Chris@14: ); Chris@14: } Chris@14: }