Code Duplication    Length = 10-12 lines in 2 locations

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

@@ 1933-1944 (lines=12) @@
1930
        // When reached here, no fatal error occured so the lock should be removed.
1931
        /*if(is_file($lock_file_path)) unlink($lock_file_path);*/
1932
1933
        if ((0 < $this->config['error_reporting']) && $msg && isset($php_errormsg)) {
1934
            $error_info = error_get_last();
1935
            if ($this->detectError($error_info['type'])) {
1936
                $msg = ($msg === false) ? 'ob_get_contents() error' : $msg;
1937
                $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', $error_info['message'], $error_info['line'], $msg);
1938
                if ($this->isBackend()) {
1939
                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>' . $msg . '</p>');
1940
                }
1941
            }
1942
        } else {
1943
            echo $msg;
1944
        }
1945
        unset($modx->event->params);
1946
    }
1947
@@ 1979-1988 (lines=10) @@
1976
        }
1977
        $echo = ob_get_contents();
1978
        ob_end_clean();
1979
        if ((0 < $this->config['error_reporting']) && isset($php_errormsg)) {
1980
            $error_info = error_get_last();
1981
            if ($this->detectError($error_info['type'])) {
1982
                $echo = ($echo === false) ? 'ob_get_contents() error' : $echo;
1983
                $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', $error_info['message'], $error_info['line'], $echo);
1984
                if ($this->isBackend()) {
1985
                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>' . $echo . $return . '</p>');
1986
                }
1987
            }
1988
        }
1989
        unset($modx->event->params);
1990
        if (is_array($return) || is_object($return)) {
1991
            return $return;