'Filter out ugly php errors and print a simple "Permission denied"
or "File not found"'

def _filter_errors(self, result, filename):

    error = None
    if result.count('Permission    denied'):
        error = PERMISSION_DENIED
    elif result.count('No    such    file    or    directory    in'):
        error = NO_SUCH_FILE
    elif result.count('Not    a    directory    in'):
        error = READ_DIRECTORY
    elif result.count(':    failed    to    open    stream:    '):
        error = FAILED_STREAM
    elif (self._file_not_found_str is not None):
        clean_result = result.replace(filename, '')
        if fuzzy_equal(self._file_not_found_str, clean_result, 0.9):
            error = NO_SUCH_FILE
    if (error is not None):
        return ''
    return result
