protected function setError(string $msg)
    {
        $this->error = $msg;
        $lastError = error_get_last();
        if ($lastError !== null) {
            $this->errorDetail = sprintf(
                "'%s' in %s on line %s",
                $lastError['message'],
                $lastError['file'],
                $lastError['line']
            );
        }
    }
protected function setError(string $msg)
    {
        $this->error = $msg;
        $lastError = error_get_last();
        if ($lastError !== null) {
            $this->errorDetail = sprintf(
                "'%s' in %s on line %s",
                $lastError['message'],
                $lastError['file'],
                $lastError['line']
            );
        }
    }
protected function setError ( string $ msg ) { $ this -> error = $ msg ; $ lastError = error_get_last ( ) ; if ( $ lastError !== null ) { $ this -> errorDetail = sprintf ( "'%s' in %s on line %s" , $ lastError [ 'message' ] , $ lastError [ 'file' ] , $ lastError [ 'line' ] ) ; } }
Set an error message

@param string $msg
Set an error message