Replace InvalidStateException usages with InvalidArgument or LogicException

This commit is contained in:
Dylan K. Taylor
2021-11-02 16:05:54 +00:00
parent 4eef458d29
commit e34364412b
15 changed files with 24 additions and 30 deletions

View File

@ -88,12 +88,9 @@ class TaskScheduler{
return $this->tasks->contains($task);
}
/**
* @throws \InvalidStateException
*/
private function addTask(Task $task, int $delay, int $period) : TaskHandler{
if(!$this->enabled){
throw new \InvalidStateException("Tried to schedule task to disabled scheduler");
throw new \LogicException("Tried to schedule task to disabled scheduler");
}
if($delay <= 0){