Code Duplication    Length = 10-12 lines in 2 locations

manager/includes/src/Core.php 2 locations

@@ 2153-2164 (lines=12) @@
2150
        // When reached here, no fatal error occured so the lock should be removed.
2151
        /*if(is_file($lock_file_path)) unlink($lock_file_path);*/
2152
2153
        if ((0 < $this->config['error_reporting']) && $msg && isset($php_errormsg)) {
2154
            $error_info = error_get_last();
2155
            if ($this->detectError($error_info['type'])) {
2156
                $msg = ($msg === false) ? 'ob_get_contents() error' : $msg;
2157
                $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', $error_info['message'], $error_info['line'], $msg);
2158
                if ($this->isBackend()) {
2159
                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>' . $msg . '</p>');
2160
                }
2161
            }
2162
        } else {
2163
            echo $msg;
2164
        }
2165
        unset($modx->event->params);
2166
    }
2167
@@ 2202-2211 (lines=10) @@
2199
        }
2200
        $echo = ob_get_contents();
2201
        ob_end_clean();
2202
        if ((0 < $this->config['error_reporting']) && isset($php_errormsg)) {
2203
            $error_info = error_get_last();
2204
            if ($this->detectError($error_info['type'])) {
2205
                $echo = ($echo === false) ? 'ob_get_contents() error' : $echo;
2206
                $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', $error_info['message'], $error_info['line'], $echo);
2207
                if ($this->isBackend()) {
2208
                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>' . $echo . $return . '</p>');
2209
                }
2210
            }
2211
        }
2212
        unset($modx->event->params);
2213
        if (is_array($return) || is_object($return)) {
2214
            return $return;