File tree Expand file tree Collapse file tree 4 files changed +17
-12
lines changed
Expand file tree Collapse file tree 4 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -52,16 +52,16 @@ public function execute(Process $model): Process
5252
5353 Bus::batch ([$ jobs ->toArray ()])
5454 ->before (function (Batch $ batch ) use ($ action ) {
55- $ action ->execute (ProcessState::Started, $ batch );
55+ $ action ->execute (Config:: getProcessStateClass ( ProcessState::class) ::Started, $ batch );
5656 })
5757 ->progress (function (Batch $ batch ) use ($ action ) {
58- $ action ->execute (ProcessState::Processing, $ batch );
58+ $ action ->execute (Config:: getProcessStateClass ( ProcessState::class) ::Processing, $ batch );
5959 })
6060 ->catch (function (Batch $ batch , Throwable $ e ) use ($ action ) {
61- $ action ->execute (ProcessState::Failed, $ batch , $ e );
61+ $ action ->execute (Config:: getProcessStateClass ( ProcessState::class) ::Failed, $ batch , $ e );
6262 })
6363 ->finally (function (Batch $ batch ) use ($ action ) {
64- $ action ->execute (ProcessState::Finished, $ batch );
64+ $ action ->execute (Config:: getProcessStateClass ( ProcessState::class) ::Finished, $ batch );
6565 })
6666 ->onConnection (Config::getQueueConnection ())
6767 ->onQueue (Config::getQueueName ())
Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ public function before(JobProcessing $event): void
3030 return ;
3131 }
3232
33- Config::getUpdateProcessStageAction ($ job ->getStage ())->execute (StageState::Started);
33+ Config::getUpdateProcessStageAction ($ job ->getStage ())
34+ ->execute (Config::getStageStateClass (StageState::class)::Started);
3435 }
3536
3637 public function after (JobProcessed $ event ): void
@@ -47,7 +48,8 @@ public function after(JobProcessed $event): void
4748 return ;
4849 }
4950
50- Config::getUpdateProcessStageAction ($ job ->getStage ())->execute (StageState::Finished);
51+ Config::getUpdateProcessStageAction ($ job ->getStage ())
52+ ->execute (Config::getStageStateClass (StageState::class)::Finished);
5153 }
5254
5355 public function failing (JobFailed $ event ): void
@@ -64,6 +66,7 @@ public function failing(JobFailed $event): void
6466 return ;
6567 }
6668
67- Config::getUpdateProcessStageAction ($ job ->getStage ())->execute (StageState::Failed);
69+ Config::getUpdateProcessStageAction ($ job ->getStage ())
70+ ->execute (Config::getStageStateClass (StageState::class)::Failed);
6871 }
6972}
Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ public function before(JobProcessing $event): void
2929 return ;
3030 }
3131
32- Config::getUpdateProcessStageAction ($ job ->getStage ())->execute (StageState::Started, $ event ->job );
32+ Config::getUpdateProcessStageAction ($ job ->getStage ())
33+ ->execute (Config::getStageStateClass (StageState::class)::Started, $ event ->job );
3334 }
3435
3536 public function after (JobProcessed $ event ): void
@@ -45,7 +46,8 @@ public function after(JobProcessed $event): void
4546 return ;
4647 }
4748
48- Config::getUpdateProcessStageAction ($ job ->getStage ())->execute (StageState::Finished, $ event ->job );
49+ Config::getUpdateProcessStageAction ($ job ->getStage ())
50+ ->execute (Config::getStageStateClass (StageState::class)::Finished, $ event ->job );
4951 }
5052
5153 public function failing (JobFailed $ event ): void
@@ -62,7 +64,7 @@ public function failing(JobFailed $event): void
6264 }
6365
6466 Config::getUpdateProcessStageAction ($ job ->getStage ())->execute (
65- StageState::Failed,
67+ Config:: getStageStateClass ( StageState::class) ::Failed,
6668 $ event ->job ,
6769 $ event ->exception
6870 );
Original file line number Diff line number Diff line change @@ -42,15 +42,15 @@ public function handle(): void
4242 UpdateProcessStageAction::class
4343 );
4444
45- $ this ->stage = $ action ->execute (StageState::Processing, $ this ->job );
45+ $ this ->stage = $ action ->execute (Config:: getStageStateClass ( StageState::class) ::Processing, $ this ->job );
4646
4747 $ stage
4848 ->setStage ($ this ->stage )
4949 ->setProcess ($ this ->process )
5050 ->setProcessable ($ this ->processable )
5151 ->execute ();
5252
53- $ this ->stage = $ action ->execute (StageState::Processed, $ this ->job );
53+ $ this ->stage = $ action ->execute (Config:: getStageStateClass ( StageState::class) ::Processed, $ this ->job );
5454 }
5555
5656 public function getStage (): Stage
You can’t perform that action at this time.
0 commit comments