From b64dd1e87eb8c7ceb0ac6075de0f034d3f951544 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Tue, 7 Jun 2016 11:11:17 +0100 Subject: [PATCH] Properly fixed metric updating // cc @jbrooksuk --- app/Bus/Commands/Metric/UpdateMetricCommand.php | 6 +++--- app/Http/Controllers/Dashboard/MetricController.php | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Bus/Commands/Metric/UpdateMetricCommand.php b/app/Bus/Commands/Metric/UpdateMetricCommand.php index 295f553b..1bf6cd26 100644 --- a/app/Bus/Commands/Metric/UpdateMetricCommand.php +++ b/app/Bus/Commands/Metric/UpdateMetricCommand.php @@ -88,7 +88,7 @@ final class UpdateMetricCommand /** * The order of which to place the metric in. * - * @var int + * @var int|null */ public $order; @@ -124,11 +124,11 @@ final class UpdateMetricCommand * @param int $places * @param int $default_view * @param int $threshold - * @param int $order + * @param int|null $order * * @return void */ - public function __construct(Metric $metric, $name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order) + public function __construct(Metric $metric, $name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order = null) { $this->metric = $metric; $this->name = $name; diff --git a/app/Http/Controllers/Dashboard/MetricController.php b/app/Http/Controllers/Dashboard/MetricController.php index 84f372e4..447e9fed 100644 --- a/app/Http/Controllers/Dashboard/MetricController.php +++ b/app/Http/Controllers/Dashboard/MetricController.php @@ -153,8 +153,7 @@ class MetricController extends Controller Binput::get('display_chart', null, false), Binput::get('places', null, false), Binput::get('default_view', null, false), - Binput::get('threshold', null, false), - null, + Binput::get('threshold', null, false) )); } catch (ValidationException $e) { return Redirect::route('dashboard.metrics.edit', ['id' => $metric->id])