Skip to content

Commit

Permalink
Add AbstractCliBasedDriver::launchProcess()
Browse files Browse the repository at this point in the history
This protected method is responsible for running the process responsible for sending the notification.
It will allow any developer that wants to override how the process in launched
  • Loading branch information
shadoWalker89 committed Sep 12, 2024
1 parent b34dac1 commit 5a90d31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Driver/AbstractCliBasedDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function send(Notification $notification): bool
}

$process = new Process(array_merge([$binary], $arguments));
$process->run();
$this->launchProcess($process);

return $this->handleExitCode($process);
}
Expand Down Expand Up @@ -125,6 +125,11 @@ protected function isBinaryAvailable(): bool
return $process->isSuccessful();
}

protected function launchProcess(Process $process): void
{
$process->run();
}

/**
* Return whether the process executed successfully.
*/
Expand Down

0 comments on commit 5a90d31

Please sign in to comment.