Code Duplication    Length = 10-12 lines in 2 locations

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

@@ 1906-1917 (lines=12) @@
1903
        // When reached here, no fatal error occured so the lock should be removed.
1904
        /*if(is_file($lock_file_path)) unlink($lock_file_path);*/
1905
1906
        if ((0 < $this->config['error_reporting']) && $msg && isset($php_errormsg)) {
1907
            $error_info = error_get_last();
1908
            if ($this->detectError($error_info['type'])) {
1909
                $msg = ($msg === false) ? 'ob_get_contents() error' : $msg;
1910
                $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', $error_info['message'], $error_info['line'], $msg);
1911
                if ($this->isBackend()) {
1912
                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>' . $msg . '</p>');
1913
                }
1914
            }
1915
        } else {
1916
            echo $msg;
1917
        }
1918
        unset($modx->event->params);
1919
    }
1920
@@ 1952-1961 (lines=10) @@
1949
        }
1950
        $echo = ob_get_contents();
1951
        ob_end_clean();
1952
        if ((0 < $this->config['error_reporting']) && isset($php_errormsg)) {
1953
            $error_info = error_get_last();
1954
            if ($this->detectError($error_info['type'])) {
1955
                $echo = ($echo === false) ? 'ob_get_contents() error' : $echo;
1956
                $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', $error_info['message'], $error_info['line'], $echo);
1957
                if ($this->isBackend()) {
1958
                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>' . $echo . $return . '</p>');
1959
                }
1960
            }
1961
        }
1962
        unset($modx->event->params);
1963
        if (is_array($return) || is_object($return)) {
1964
            return $return;