Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched from using \Exception to using \Throwable #143

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/GO/FailedJob.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php namespace GO;

use Exception;
use Throwable;

class FailedJob
{
Expand All @@ -10,11 +10,11 @@ class FailedJob
private $job;

/**
* @var Exception
* @var Throwable
*/
private $exception;

public function __construct(Job $job, Exception $exception)
public function __construct(Job $job, Throwable $exception)
{
$this->job = $job;
$this->exception = $exception;
Expand All @@ -25,7 +25,7 @@ public function getJob(): Job
return $this->job;
}

public function getException(): Exception
public function getException(): Throwable
{
return $this->exception;
}
Expand Down
6 changes: 3 additions & 3 deletions src/GO/Job.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace GO;

use DateTime;
use Exception;
use Throwable;
use InvalidArgumentException;

class Job
Expand Down Expand Up @@ -433,7 +433,7 @@ private function removeLockFile()
* Execute a callable job.
*
* @param callable $fn
* @throws Exception
* @throws Throwable
* @return string
*/
private function exec(callable $fn)
Expand All @@ -442,7 +442,7 @@ private function exec(callable $fn)

try {
$returnData = call_user_func_array($fn, $this->args);
} catch (Exception $e) {
} catch (Throwable $e) {
ob_end_clean();
throw $e;
}
Expand Down
8 changes: 4 additions & 4 deletions src/GO/Scheduler.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace GO;

use DateTime;
use Exception;
use Throwable;
use InvalidArgumentException;

class Scheduler
Expand Down Expand Up @@ -176,7 +176,7 @@ public function run(Datetime $runTime = null)
try {
$job->run();
$this->pushExecutedJob($job);
} catch (\Exception $e) {
} catch (Throwable $e) {
$this->pushFailedJob($job, $e);
}
}
Expand Down Expand Up @@ -251,10 +251,10 @@ public function getExecutedJobs()
* Push a failed job.
*
* @param Job $job
* @param Exception $e
* @param Throwable $e
* @return Job
*/
private function pushFailedJob(Job $job, Exception $e)
private function pushFailedJob(Job $job, Throwable $e)
{
$this->failedJobs[] = new FailedJob($job, $e);

Expand Down