Code Duplication    Length = 10-12 lines in 2 locations

manager/includes/src/Core.php 2 locations

@@ 2180-2191 (lines=12) @@
2177
        // When reached here, no fatal error occured so the lock should be removed.
2178
        /*if(is_file($lock_file_path)) unlink($lock_file_path);*/
2179
2180
        if ((0 < $this->config['error_reporting']) && $msg && isset($php_errormsg)) {
2181
            $error_info = error_get_last();
2182
            if ($this->detectError($error_info['type'])) {
2183
                $msg = ($msg === false) ? 'ob_get_contents() error' : $msg;
2184
                $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', $error_info['message'], $error_info['line'], $msg);
2185
                if ($this->isBackend()) {
2186
                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>' . $msg . '</p>');
2187
                }
2188
            }
2189
        } else {
2190
            echo $msg;
2191
        }
2192
        unset($modx->event->params);
2193
    }
2194
@@ 2229-2238 (lines=10) @@
2226
        }
2227
        $echo = ob_get_contents();
2228
        ob_end_clean();
2229
        if ((0 < $this->config['error_reporting']) && isset($php_errormsg)) {
2230
            $error_info = error_get_last();
2231
            if ($this->detectError($error_info['type'])) {
2232
                $echo = ($echo === false) ? 'ob_get_contents() error' : $echo;
2233
                $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', $error_info['message'], $error_info['line'], $echo);
2234
                if ($this->isBackend()) {
2235
                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>' . $echo . $return . '</p>');
2236
                }
2237
            }
2238
        }
2239
        unset($modx->event->params);
2240
        if (is_array($return) || is_object($return)) {
2241
            return $return;