Code Duplication    Length = 10-12 lines in 2 locations

manager/includes/src/Core.php 2 locations

@@ 2161-2172 (lines=12) @@
2158
        // When reached here, no fatal error occured so the lock should be removed.
2159
        /*if(is_file($lock_file_path)) unlink($lock_file_path);*/
2160
2161
        if ((0 < $this->config['error_reporting']) && $msg && isset($php_errormsg)) {
2162
            $error_info = error_get_last();
2163
            if ($this->detectError($error_info['type'])) {
2164
                $msg = ($msg === false) ? 'ob_get_contents() error' : $msg;
2165
                $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', $error_info['message'], $error_info['line'], $msg);
2166
                if ($this->isBackend()) {
2167
                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>' . $msg . '</p>');
2168
                }
2169
            }
2170
        } else {
2171
            echo $msg;
2172
        }
2173
        unset($modx->event->params);
2174
    }
2175
@@ 2210-2219 (lines=10) @@
2207
        }
2208
        $echo = ob_get_contents();
2209
        ob_end_clean();
2210
        if ((0 < $this->config['error_reporting']) && isset($php_errormsg)) {
2211
            $error_info = error_get_last();
2212
            if ($this->detectError($error_info['type'])) {
2213
                $echo = ($echo === false) ? 'ob_get_contents() error' : $echo;
2214
                $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', $error_info['message'], $error_info['line'], $echo);
2215
                if ($this->isBackend()) {
2216
                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>' . $echo . $return . '</p>');
2217
                }
2218
            }
2219
        }
2220
        unset($modx->event->params);
2221
        if (is_array($return) || is_object($return)) {
2222
            return $return;