Code Duplication    Length = 20-22 lines in 2 locations

core/src/Core.php 2 locations

@@ 1765-1786 (lines=22) @@
1762
        /*if(is_file($lock_file_path)) unlink($lock_file_path);*/
1763
        $error_info = error_get_last();
1764
1765
        if ((0 < $this->getConfig('error_reporting')) && $msg && $error_info !== null && $this->detectError($error_info['type'])) {
1766
            $msg = ($msg === false) ? 'ob_get_contents() error' : $msg;
1767
            $this->getService('ExceptionHandler')->messageQuit(
1768
                'PHP Parse Error',
1769
                '',
1770
                true,
1771
                $error_info['type'],
1772
                $error_info['file'],
1773
                'Plugin',
1774
                $error_info['message'],
1775
                $error_info['line'],
1776
                $msg
1777
            );
1778
            if ($this->isBackend()) {
1779
                $this->event->alert(
1780
                    'An error occurred while loading. Please see the event log for more information.' .
1781
                    '<p>' . $msg . '</p>'
1782
                );
1783
            }
1784
        } else {
1785
            echo $msg;
1786
        }
1787
        unset($modx->event->params);
1788
    }
1789
@@ 1825-1844 (lines=20) @@
1822
        $echo = ob_get_contents();
1823
        ob_end_clean();
1824
        $error_info = error_get_last();
1825
        if ((0 < $this->getConfig('error_reporting')) && $error_info !== null && $this->detectError($error_info['type'])) {
1826
            $echo = ($echo === false) ? 'ob_get_contents() error' : $echo;
1827
            $this->getService('ExceptionHandler')->messageQuit(
1828
                'PHP Parse Error',
1829
                '',
1830
                true,
1831
                $error_info['type'],
1832
                $error_info['file'],
1833
                'Snippet',
1834
                $error_info['message'],
1835
                $error_info['line'],
1836
                $echo
1837
            );
1838
            if ($this->isBackend()) {
1839
                $this->event->alert(
1840
                    'An error occurred while loading. Please see the event log for more information' .
1841
                    '<p>' . $echo . $return . '</p>'
1842
                );
1843
            }
1844
        }
1845
        unset($modx->event->params);
1846
        if (is_array($return) || is_object($return)) {
1847
            return $return;