Aggregates previously collected coverage information.

@return string
15367
public function aggregateCoverageInformation()
	{
		if ( !isset($_GET[self::TEST_ID_VARIABLE]) ) {
			return '';
		}

		$coverage = array();
		$filter = new \PHP_CodeCoverage_Filter();

		foreach ( $this->getDataDirectoryFiles() as $data_directory_file ) {
			$raw_coverage_data = unserialize(file_get_contents($data_directory_file));

			foreach ( $raw_coverage_data as $file => $lines ) {
				if ( !$filter->isFile($file) ) {
					continue;
				}

				if ( !isset($coverage[$file]) ) {
					$coverage[$file] = array('md5' => md5_file($file), 'coverage' => $lines);
				}
				else {
					foreach ( $lines as $line => $flag ) {
						if ( !isset($coverage[$file]['coverage'][$line])
							|| $flag > $coverage[$file]['coverage'][$line]
						) {
							$coverage[$file]['coverage'][$line] = $flag;
						}
					}
				}
			}
		}

		return serialize($coverage);
	}
750184
public function getSummaryString() {
    $summary = array();
    if (is_array($s = $this->getSummary()) && !empty($s)) {
      foreach ($this->getSummary() as $summaryAttributes) {
        $item = array();
        if (is_array($summaryAttributes) && !empty($summaryAttributes)) {
          foreach ($summaryAttributes as $k => $v) {
            $item[] = $k . ":" . $v;
          }
        }
        $summary[] = implode(",", $item);
      }
    }
    return implode(";", $summary);
  }
195251
public function aggregated()
    {
        if ($this->getEntityState() & AnDomain::STATE_NEW) {
            return false;
        }

        if ($this->getRowData('bundle_key') == null) {
            return false;
        }

        return count($this->getIds()) > 1;
    }
1257940
public function getTrashed()
    {
        if (!$this->modelAdmin->hasSoftDeleting()) {
            return $this->missingMethod();
        }

        return view('flare::admin.modeladmin.trashed', [
                                                        'modelItems' => $this->modelAdmin->onlyTrashedItems(),
                                                        'totals' => $this->modelAdmin->totals(),
                                                    ]
                                                );
    }
966614
public function getTotalCodeCoverage() {
		$totalStatements = 0;
		$totalCoveredStatements = 0;
		foreach ($this->getFiles() as $file) {
			$totalStatements += $file->getStatements();
			$totalCoveredStatements += $file->getCoveredStatements();
		}
		foreach ($this->getPackages() as $package) {
			foreach ($package->getFiles() as $file) {
				$totalStatements += $file->getStatements();
				$totalCoveredStatements += $file->getCoveredStatements();
			}
		}

		return ($totalCoveredStatements==0?0:\round(($totalCoveredStatements/$totalStatements)*100));
	}
849993
public function getLastIndexingReport()
    {
        $queryBuilder = Db::getQueryBuilder('sys_log');
        $logResults = $queryBuilder
            ->select('*')
            ->from('sys_log')
            ->where(
                $queryBuilder->expr()->like(
                    'details',
                    $queryBuilder->quote('[ke_search]%', \PDO::PARAM_STR)
                )
            )
            ->orderBy('tstamp', 'DESC')
            ->setMaxResults(1)
            ->execute()
            ->fetchAll();

        return $logResults;
    }
1165013
public function getMeasuredCronInterval()
    {
        $lastRuns = Mage::app()->loadCache(self::CACHE_KEY_SCHEDULER_LASTRUNS);
        $lastRuns = array_values(array_filter(explode(',', $lastRuns)));
        if (count($lastRuns) < 3) {
            // not enough data points
            return false;
        }
        $gaps = array();
        foreach ($lastRuns as $index => $run) {
            if ($index > 0) {
                $gaps[$index] = intval($lastRuns[$index]) - intval($lastRuns[$index-1]);
            }
        }
        return array(
            'average' => round((array_sum($gaps) / count($gaps)) / 60, 2),
            'max' => round(max($gaps) / 60, 2),
            'min' => round(min($gaps) / 60, 2),
            'count' => count($gaps),
            'last' => end($lastRuns)
        );
    }
139508
public function getLastModified()
    {
        if (!count($this->assets)) {
            return;
        }

        $mtime = 0;
        foreach ($this as $asset) {
            $assetMtime = $asset->getLastModified();
            if ($assetMtime > $mtime) {
                $mtime = $assetMtime;
            }
        }

        return $mtime;
    }
703897
public function getPrev()
    {
        end($this->groups);
        while ($key = key($this->groups)) {
            $prevGroup = prev($this->groups);

            if ($this->groups[$key] === $this->group && $prevGroup) {
                return $prevGroup;
            }
        }

        return $this->group;
    }
674933
protected function logCoverage()
    {
        if (!$this->hasCoverage()) {
            return;
        }

        $filteredOptions = $this->options->filtered;

        $reporter = $this->getCoverage()->getReporter();

        if (isset($filteredOptions['coverage-clover'])) {
            $reporter->clover($filteredOptions['coverage-clover']);
        }

        if (isset($filteredOptions['coverage-html'])) {
            $reporter->html($filteredOptions['coverage-html']);
        }
        if (isset($filteredOptions['coverage-text'])) {
            $reporter->text();
        }

        if (isset($filteredOptions['coverage-xml'])) {
            $reporter->xml($filteredOptions['coverage-xml']);
        }

        $reporter->php($filteredOptions['coverage-php']);
    }
111674
public function collectStats()
    {
        Container::get('hooks')->fire('model.index.collect_stats_start');

        // Collect some statistics from the database
        if (!Container::get('cache')->isCached('users_info')) {
            Container::get('cache')->store('users_info', Cache::getUsersInfo());
        }

        $stats = Container::get('cache')->retrieve('users_info');

        $query = DB::forTable('forums')
            ->select_expr('SUM(num_topics)', 'total_topics')
            ->select_expr('SUM(num_posts)', 'total_posts');

        $query = Container::get('hooks')->fireDB('model.index.collect_stats_query', $query);

        $query = $query->find_one();

        $stats['total_topics'] = Utils::numberFormat((int)$query['total_topics']);
        $stats['total_posts'] = Utils::numberFormat((int)$query['total_posts']);

        if (User::get()->g_view_users == '1') {
            $stats['newest_user'] = '<a href="'.
                Router::pathFor('userProfile', ['id' => $stats['last_user']['id']]).'">'.
                Utils::escape($stats['last_user']['username']).'</a>';
        } else {
            $stats['newest_user'] = Utils::escape($stats['last_user']['username']);
        }
        $stats['total_users'] = Utils::numberFormat((int)$stats['total_users']);

        $stats = Container::get('hooks')->fire('model.index.collect_stats', $stats);

        return $stats;
    }
710697
public function get_description() {
        $allhelp = array();
        if ($this->aggregation != GRADE_AGGREGATE_SUM) {
            $aggrstrings = grade_helper::get_aggregation_strings();
            $allhelp[] = $aggrstrings[$this->aggregation];
        }

        if ($this->droplow && $this->can_apply_limit_rules()) {
            $allhelp[] = get_string('droplowestvalues', 'grades', $this->droplow);
        }
        if ($this->keephigh && $this->can_apply_limit_rules()) {
            $allhelp[] = get_string('keephighestvalues', 'grades', $this->keephigh);
        }
        if (!$this->aggregateonlygraded) {
            $allhelp[] = get_string('aggregatenotonlygraded', 'grades');
        }
        if ($allhelp) {
            return implode('. ', $allhelp) . '.';
        }
        return '';
    }
1052038
public function collectAndSendCoverage($args)
    {
        // Collect and write out the data
        $this->collectAndWriteCoverage($args);

        if ($this->valid($args)) {
            extract($args);

            // Get the realpath coverage directory
            $coverage_dir = realpath($coverage_dir);
            $coverage_output = $coverage_dir.DIRECTORY_SEPARATOR.self::COVERAGE_OUTPUT;

            // Send it!
            $this->printer->out('Sending coverage output...');


            // Workaround for cURL create file
            if (function_exists('curl_file_create')) {
                $payload = curl_file_create('json_file', 'application/json', $coverage_output);
            } else {
                $payload = array('json_file'=>'@'.$coverage_output);
            }

            $ch = curl_init(); 
            curl_setopt($ch, CURLOPT_URL, $target_url); 
            curl_setopt($ch, CURLOPT_POST,1); 
            curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);

            // Save output into output buffer
            ob_start();
            $result = curl_exec ($ch); 
            $curlOutput = ob_get_contents();
            ob_end_clean();

            curl_close ($ch); 
            $this->printer->printOut('cURL Output:'.$curlOutput); 
            $this->printer->printOut('cURL Result:'.$result);
        }
    }
376737
public function aggregate()
    {
        $commands = [];
        foreach ($this->getVisibleCommands() as $name => $cmd) {
            $commands[$name] = $cmd;
        }

        foreach ($this->commandGroups as $g) {
            if ($g->isHidden) {
                continue;
            }
            foreach ($g->getCommands() as $name => $cmd) {
                unset($commands[$name]);
            }
        }

        uasort($this->commandGroups, function ($a, $b) {
            if ($a->getId() === 'dev') {
                return 1;
            }

            return 0;
        });

        return [
            'groups' => $this->commandGroups,
            'commands' => $commands,
        ];
    }
205817
public function getPrev()
    {
        return self::find()->where(['<', 'id', $this->id])->orderBy(['id' => SORT_DESC])->limit(1)->one();
    }
880264
public function getTrackRestoreCodes()
    {
        $select = $this->_getRestoreSelect();
        $select->where('(grc_for_tracks = 1 OR grc_for_surveys = ?)', self::APPLY_STOP);

        return $this->_translateAndSort($this->db->fetchPairs($select));
    }
1235267
public function getLastLevelOfdataTypes()
    {
        $dataTypes = $this->getDataTypes();
        $lastLevel = array();
        foreach ($dataTypes as $key1 => $value1) {
            if (! array_key_exists('children', $value1))
                $lastLevel[$key1] = $value1;
            else
                foreach ($value1['children'] as $key2 => $value2)
                    $lastLevel[$key2] = $value2;
        }
        return $lastLevel;
    }