Code Duplication    Length = 10-12 lines in 2 locations

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

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