public function displayErrors($htmlOutput = true){

        $returnValue = (string) '';

        foreach($this->errors as $error){
            $returnValue .= $error['message'];
            if(isset($error['file']) && isset($error['line'])){
                $returnValue .= ' in file '.$error['file'].', line '.$error['line'];
            }
            $returnValue .= PHP_EOL;
        }

        if($htmlOutput){
            $returnValue = nl2br($returnValue);
        }

        return (string) $returnValue;
    }