From a593dabeb992f5753b14c7e7ac7dd942d2318954 Mon Sep 17 00:00:00 2001 From: Joseph Cohen Date: Sun, 22 Nov 2015 00:18:09 -0600 Subject: [PATCH] Fix some nulls and the notifications on the handlers --- .../Commands/Incident/ReportIncidentCommandHandler.php | 2 ++ .../Commands/Incident/ReportMaintenanceCommandHandler.php | 2 ++ app/Http/Controllers/SignupController.php | 4 ++-- app/Http/Controllers/SubscribeController.php | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/Handlers/Commands/Incident/ReportIncidentCommandHandler.php b/app/Handlers/Commands/Incident/ReportIncidentCommandHandler.php index b9a0d379..206ce233 100644 --- a/app/Handlers/Commands/Incident/ReportIncidentCommandHandler.php +++ b/app/Handlers/Commands/Incident/ReportIncidentCommandHandler.php @@ -84,6 +84,8 @@ class ReportIncidentCommandHandler ]); } + $incident->notify = (bool) $command->notify; + event(new IncidentWasReportedEvent($incident)); return $incident; diff --git a/app/Handlers/Commands/Incident/ReportMaintenanceCommandHandler.php b/app/Handlers/Commands/Incident/ReportMaintenanceCommandHandler.php index 556d87f1..f704346a 100644 --- a/app/Handlers/Commands/Incident/ReportMaintenanceCommandHandler.php +++ b/app/Handlers/Commands/Incident/ReportMaintenanceCommandHandler.php @@ -56,6 +56,8 @@ class ReportMaintenanceCommandHandler 'visible' => 1, ]); + $maintenanceEvent->notify = (bool) $command->notify; + event(new MaintenanceWasScheduledEvent($maintenanceEvent)); return $maintenanceEvent; diff --git a/app/Http/Controllers/SignupController.php b/app/Http/Controllers/SignupController.php index 4fbd1dfa..39c815d5 100644 --- a/app/Http/Controllers/SignupController.php +++ b/app/Http/Controllers/SignupController.php @@ -36,7 +36,7 @@ class SignupController extends Controller */ public function getSignup($code = null) { - if ($code !== null) { + if ($code === null) { throw new NotFoundHttpException(); } @@ -61,7 +61,7 @@ class SignupController extends Controller */ public function postSignup($code = null) { - if ($code !== null) { + if ($code === null) { throw new NotFoundHttpException(); } diff --git a/app/Http/Controllers/SubscribeController.php b/app/Http/Controllers/SubscribeController.php index 7d5c6b52..6cb348ad 100644 --- a/app/Http/Controllers/SubscribeController.php +++ b/app/Http/Controllers/SubscribeController.php @@ -70,7 +70,7 @@ class SubscribeController extends Controller */ public function getVerify($code = null) { - if ($code !== null) { + if ($code === null) { throw new NotFoundHttpException(); } @@ -95,7 +95,7 @@ class SubscribeController extends Controller */ public function getUnsubscribe($code = null) { - if ($code !== null) { + if ($code === null) { throw new NotFoundHttpException(); }