public function registerError($level, callable $callback)
    {
        $reflection = new \ReflectionFunction($callback);
        $parameters = $reflection->getParameters();
        if (count($parameters) > 4) {
            throw new \Exception("Specified callback cannot have more than 4 arguments (message, file, line, context)");
        }
        $this->registeredErrorCallbacks[$level] = $callback;
    }
public function registerError($level, callable $callback)
    {
        $reflection = new \ReflectionFunction($callback);
        $parameters = $reflection->getParameters();
        if (count($parameters) > 4) {
            throw new \Exception("Specified callback cannot have more than 4 arguments (message, file, line, context)");
        }
        $this->registeredErrorCallbacks[$level] = $callback;
    }
public function registerError ( $ level , callable $ callback ) { $ reflection = new \ ReflectionFunction ( $ callback ) ; $ parameters = $ reflection -> getParameters ( ) ; if ( count ( $ parameters ) > 4 ) { throw new \ Exception ( "Specified callback cannot have more than 4 arguments (message, file, line, context)" ) ; } $ this -> registeredErrorCallbacks [ $ level ] = $ callback ; }
Register an error level with a specific user defined callback. The
specified callback can have up to 4 arguments, but they are not
required. First provided argument is the message, second is the file
path, third is the line number and the fourth is an error context.

@param int $level
@param callable $callback
@throws \Exception
Register an error level with a specific user defined callback . The specified callback can have up to 4 arguments but they are not required . First provided argument is the message second is the file path third is the line number and the fourth is an error context .