Apply fixes from StyleCI (#2962)

[ci skip] [skip ci]
This commit is contained in:
James Brooks 2018-03-26 19:18:30 +01:00 committed by GitHub
parent 83bc743d79
commit 0c72e5eec8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -50,13 +50,14 @@ abstract class AbstractMetricRepository
/**
* Get the table names prefix.
*
* @return string
* @return string
*/
protected function getPrefix()
{
$driver = $this->config->get('database.default');
$connection = $this->config->get('database.connections.'.$driver);
$prefix = $connection['prefix'];
return $prefix;
}
@ -68,17 +69,19 @@ abstract class AbstractMetricRepository
protected function getTableName()
{
$prefix = $this->getPrefix();
return $prefix.'metrics';
}
/**
* Get the metric points table name.
*
* @return string
* @return string
*/
protected function getMetricPointsTableName()
{
$prefix = $this->getPrefix();
return $prefix.'metric_points';
}
}

View File

@ -38,7 +38,6 @@ class MySqlRepository extends AbstractMetricRepository implements MetricInterfac
$timeInterval = $dateTime->format('YmdHi');
$metricPointsTableName = $this->getMetricPointsTableName();
if (!isset($metric->calc_type) || $metric->calc_type == Metric::CALC_SUM) {
$queryType = 'SUM(mp.`value` * mp.`counter`) AS `value`';
} elseif ($metric->calc_type == Metric::CALC_AVG) {