Code Duplication    Length = 10-12 lines in 2 locations

manager/includes/document.parser.class.inc.php 2 locations

@@ 1922-1933 (lines=12) @@
1919
        // When reached here, no fatal error occured so the lock should be removed.
1920
        /*if(is_file($lock_file_path)) unlink($lock_file_path);*/
1921
1922
        if ((0 < $this->config['error_reporting']) && $msg && isset($php_errormsg)) {
1923
            $error_info = error_get_last();
1924
            if ($this->detectError($error_info['type'])) {
1925
                $msg = ($msg === false) ? 'ob_get_contents() error' : $msg;
1926
                $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', $error_info['message'], $error_info['line'], $msg);
1927
                if ($this->isBackend()) {
1928
                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>' . $msg . '</p>');
1929
                }
1930
            }
1931
        } else {
1932
            echo $msg;
1933
        }
1934
        unset($modx->event->params);
1935
    }
1936
@@ 1968-1977 (lines=10) @@
1965
        }
1966
        $echo = ob_get_contents();
1967
        ob_end_clean();
1968
        if ((0 < $this->config['error_reporting']) && isset($php_errormsg)) {
1969
            $error_info = error_get_last();
1970
            if ($this->detectError($error_info['type'])) {
1971
                $echo = ($echo === false) ? 'ob_get_contents() error' : $echo;
1972
                $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', $error_info['message'], $error_info['line'], $echo);
1973
                if ($this->isBackend()) {
1974
                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>' . $echo . $return . '</p>');
1975
                }
1976
            }
1977
        }
1978
        unset($modx->event->params);
1979
        if (is_array($return) || is_object($return)) {
1980
            return $return;