Code Duplication    Length = 6-6 lines in 3 locations

lib/midcom/core/querybuilder.php 1 location

@@ 80-85 (lines=6) @@
77
            return array();
78
        }
79
80
        if (!is_array($result))
81
        {
82
            debug_add('Last Midgard error was: ' . midcom_connection::get_error_string(), MIDCOM_LOG_ERROR);
83
            midcom::get()->debug->log_php_error(MIDCOM_LOG_ERROR);
84
            return array();
85
        }
86
        if (   empty($result)
87
            && $false_on_empty_mgd_resultset)
88
        {

lib/midcom/db/attachment.php 1 location

@@ 478-483 (lines=6) @@
475
    public function copy_from_file($filename)
476
    {
477
        $source = @fopen ($filename, 'r');
478
        if (! $source)
479
        {
480
            debug_add('Could not open file for reading.' . midcom_connection::get_error_string(), MIDCOM_LOG_WARN);
481
            midcom::get()->debug->log_php_error(MIDCOM_LOG_WARN);
482
            return false;
483
        }
484
        $result = $this->copy_from_handle($source);
485
        fclose($source);
486
        return $result;

lib/midcom/services/cache/module/phpscripts.php 1 location

@@ 137-142 (lines=6) @@
134
    {
135
        $filename = "{$this->_cache_dir}{$identifier}.php";
136
137
        if (!file_put_contents($filename, "<?php\n{$code}\n?>\n"))
138
        {
139
            debug_add("Failed to write to the file {$filename}.", MIDCOM_LOG_ERROR);
140
            midcom::get()->debug->log_php_error(MIDCOM_LOG_ERROR);
141
            return false;
142
        }
143
144
        if (!$skip_load)
145
        {