Code Duplication    Length = 10-12 lines in 2 locations

manager/includes/src/Core.php 2 locations

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