Skip to content

Commit

Permalink
Add actual check for process string's datatype as no exception was be…
Browse files Browse the repository at this point in the history
…ing thrown
  • Loading branch information
Martin de Keijzer committed Apr 11, 2023
1 parent d9508a3 commit 0f12cef
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Broadcaster/Scheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,17 @@ protected function getRunningBroadcasts(): array
$processStrings = $this->schedulerCommands->getRunningProcesses();

foreach ($processStrings as $processString) {
$broadcastId = $this->schedulerCommands->getBroadcastId($processString);
$processId = $this->schedulerCommands->getProcessId($processString);
$channelId = $this->schedulerCommands->getChannelId($processString);
$environment = $this->schedulerCommands->getEnvironment($processString);

try {
$runningItem = new RunningBroadcast(
$this->schedulerCommands->getBroadcastId($processString),
$this->schedulerCommands->getProcessId($processString),
$this->schedulerCommands->getChannelId($processString),
$this->schedulerCommands->getEnvironment($processString)
);
if (!is_int($broadcastId) || !is_int($processId) || !is_int($channelId)) {
throw new \Exception('Invalid process string');
}

$runningItem = new RunningBroadcast($broadcastId, $processId, $channelId, $environment);

if ($runningItem->isValid($this->schedulerCommands->getKernelEnvironment())) {
$runningBroadcasts[] = $runningItem;
Expand Down

0 comments on commit 0f12cef

Please sign in to comment.