Code Duplication    Length = 10-12 lines in 2 locations

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

@@ 1963-1974 (lines=12) @@
1960
        // When reached here, no fatal error occured so the lock should be removed.
1961
        /*if(is_file($lock_file_path)) unlink($lock_file_path);*/
1962
1963
        if ((0 < $this->config['error_reporting']) && $msg && isset($php_errormsg)) {
1964
            $error_info = error_get_last();
1965
            if ($this->detectError($error_info['type'])) {
1966
                $msg = ($msg === false) ? 'ob_get_contents() error' : $msg;
1967
                $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin',
1968
                    $error_info['message'], $error_info['line'], $msg);
1969
                if ($this->isBackend()) {
1970
                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>' . $msg . '</p>');
1971
                }
1972
            }
1973
        } else {
1974
            echo $msg;
1975
        }
1976
        unset($modx->event->params);
1977
    }
@@ 2010-2019 (lines=10) @@
2007
        }
2008
        $echo = ob_get_contents();
2009
        ob_end_clean();
2010
        if ((0 < $this->config['error_reporting']) && isset($php_errormsg)) {
2011
            $error_info = error_get_last();
2012
            if ($this->detectError($error_info['type'])) {
2013
                $echo = ($echo === false) ? 'ob_get_contents() error' : $echo;
2014
                $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet',
2015
                    $error_info['message'], $error_info['line'], $echo);
2016
                if ($this->isBackend()) {
2017
                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>' . $echo . $return . '</p>');
2018
                }
2019
            }
2020
        }
2021
        unset($modx->event->params);
2022
        if (is_array($return) || is_object($return)) {