function TestLogger::__call
Parameters
array<int, mixed> $args:
File
-
vendor/
colinodell/ psr-testlogger/ src/ TestLogger.php, line 151
Class
- TestLogger
- Used for testing purposes.
Namespace
ColinODell\PsrTestLoggerCode
public function __call(string $method, array $args) : bool {
if (\preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
$genericMethod = $matches[1] . ($matches[3] !== 'Records' ? 'Record' : '') . $matches[3];
$callable = [
$this,
$genericMethod,
];
$level = \strtolower($matches[2]);
if (\is_callable($callable)) {
$args[] = $level;
return \call_user_func_array($callable, $args);
}
}
throw new \BadMethodCallException('Call to undefined method ' . self::class . '::' . $method . '()');
}