From 129f1861d16eb01ceaa14d21e7025fb9117b0df6 Mon Sep 17 00:00:00 2001 From: Shawn Rice Date: Wed, 27 Mar 2024 07:32:43 -0400 Subject: [PATCH] refactor(resources): Use constants for readability --- .../Resources/Console/EmailSchedulingCommand.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Modules/Resources/Console/EmailSchedulingCommand.php b/app/Modules/Resources/Console/EmailSchedulingCommand.php index 364810383..c582f4869 100644 --- a/app/Modules/Resources/Console/EmailSchedulingCommand.php +++ b/app/Modules/Resources/Console/EmailSchedulingCommand.php @@ -45,7 +45,7 @@ public function handle(): void ->join($c, $c . '.subresourceid', $s . '.id') ->join($a, $a . '.id', $c . '.resourceid') ->whereNull($a . '.datetimeremoved') - ->where($s . '.notice', '=', 2) + ->where($s . '.notice', '=', Subresource::NOTICE_JUST_STOPPED) ->get(); if (count($stopped)) @@ -72,7 +72,7 @@ public function handle(): void foreach ($stopped as $subresource) { - $subresource->update(['notice' => 3]); + $subresource->update(['notice' => Subresource::NOTICE_STILL_STOPPED]); } } } @@ -86,7 +86,7 @@ public function handle(): void ->join($c, $c . '.subresourceid', $s . '.id') ->join($a, $a . '.id', $c . '.resourceid') ->whereNull($a . '.datetimeremoved') - ->where($s . '.notice', '=', 1) + ->where($s . '.notice', '=', Subresource::NOTICE_JUST_STARTED) ->get(); $stopped = Subresource::query() @@ -94,7 +94,7 @@ public function handle(): void ->join($c, $c . '.subresourceid', $s . '.id') ->join($a, $a . '.id', $c . '.resourceid') ->whereNull($a . '.datetimeremoved') - ->where($s . '.notice', '=', 3) + ->where($s . '.notice', '=', Subresource::NOTICE_STILL_STOPPED) ->get(); if (count($started)) @@ -123,7 +123,7 @@ public function handle(): void foreach ($started as $subresource) { - $subresource->update(['notice' => 0]); + $subresource->update(['notice' => Subresource::NO_NOTICE]); } } elseif ($debug || $this->output->isVerbose())