Skip to content

Commit

Permalink
Apply fixes from StyleCI (#2962)
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]
  • Loading branch information
jbrooksuk authored Mar 26, 2018
1 parent 83bc743 commit 0c72e5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 5 additions & 2 deletions app/Repositories/Metric/AbstractMetricRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ public function __construct(Repository $config)
/**
* 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;
}

Expand All @@ -68,17 +69,19 @@ protected function getPrefix()
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';
}
}
1 change: 0 additions & 1 deletion app/Repositories/Metric/MySqlRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public function getPointsLastHour(Metric $metric, $hour, $minute)
$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) {
Expand Down

0 comments on commit 0c72e5e

Please sign in to comment.