Apply fixes from StyleCI

This commit is contained in:
Dane Everitt 2016-12-07 22:46:38 +00:00 committed by StyleCI Bot
parent a1d3bbf73d
commit c1fb0a665f
150 changed files with 1558 additions and 1760 deletions

View file

@ -1,7 +1,7 @@
<?php
/**
* Pterodactyl - Panel
* Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com>
* Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -21,19 +21,17 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
namespace Pterodactyl\Jobs;
use Pterodactyl\Jobs\Job;
use Cron;
use Carbon;
use Pterodactyl\Models;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use DB;
use Carbon;
use Cron;
use Pterodactyl\Models;
use Pterodactyl\Repositories\Daemon\CommandRepository;
use Pterodactyl\Repositories\Daemon\PowerRepository;
use Pterodactyl\Repositories\Daemon\CommandRepository;
class SendScheduledTask extends Job implements ShouldQueue
{
@ -76,7 +74,7 @@ class SendScheduledTask extends Job implements ShouldQueue
if ($this->task->action === 'command') {
$repo = new CommandRepository($this->server);
$response = $repo->send($this->task->data);
} else if ($this->task->action === 'power') {
} elseif ($this->task->action === 'power') {
$repo = new PowerRepository($this->server);
$response = $repo->do($this->task->data);
}
@ -84,14 +82,14 @@ class SendScheduledTask extends Job implements ShouldQueue
'task_id' => $this->task->id,
'run_time' => $time,
'run_status' => 0,
'response' => $response
'response' => $response,
]);
} catch (\Exception $ex) {
$log->fill([
'task_id' => $this->task->id,
'run_time' => $time,
'run_status' => 1,
'response' => $ex->getMessage()
'response' => $ex->getMessage(),
]);
} finally {
$cron = Cron::factory(sprintf('%s %s %s %s %s %s',
@ -105,7 +103,7 @@ class SendScheduledTask extends Job implements ShouldQueue
$this->task->fill([
'last_run' => $time,
'next_run' => $cron->getNextRunDate(),
'queued' => 0
'queued' => 0,
]);
$this->task->save();
$log->save();