public function error($code, $info = [], $level = E_USER_ERROR, $trace = true)
    {
        if ($this->configList[self::EXCEPTIONS]) {
            throw new SavantPHPexception($code);
        }
        // the error config array
        $config = [
            'code'  => $code,
            'info'  => (array) $info,
            'level' => $level,
            'trace' => $trace
        ];
        return new SavantPHPerror($config);
    }
public function error($code, $info = [], $level = E_USER_ERROR, $trace = true)
    {
        if ($this->configList[self::EXCEPTIONS]) {
            throw new SavantPHPexception($code);
        }
        // the error config array
        $config = [
            'code'  => $code,
            'info'  => (array) $info,
            'level' => $level,
            'trace' => $trace
        ];
        return new SavantPHPerror($config);
    }
public function error ( $ code , $ info = [ ] , $ level = E_USER_ERROR , $ trace = true ) { if ( $ this -> configList [ self :: EXCEPTIONS ] ) { throw new SavantPHPexception ( $ code ) ; } // the error config array $ config = [ 'code' => $ code , 'info' => ( array ) $ info , 'level' => $ level , 'trace' => $ trace ] ; return new SavantPHPerror ( $ config ) ; }
Returns an error object or throws an exception.

@param $code
@param array $info
@param int $level
@param bool $trace
@return SavantPHPerror
@throws SavantPHPexception
Returns an error object or throws an exception .