diff --git a/app/Console/Commands/RebuildServer.php b/app/Console/Commands/RebuildServer.php index 7581a72ac..2177b112a 100644 --- a/app/Console/Commands/RebuildServer.php +++ b/app/Console/Commands/RebuildServer.php @@ -72,6 +72,7 @@ class RebuildServer extends Command $servers = Server::where('id', $this->option('server'))->get(); } else { $this->error('You must pass a flag to determine which server(s) to rebuild.'); + return; } @@ -80,7 +81,7 @@ class RebuildServer extends Command $this->line('Beginning processing, do not exit this script.'); $bar = $this->output->createProgressBar(count($servers)); $results = collect([]); - foreach($servers as $server) { + foreach ($servers as $server) { try { $environment = $server->option->variables->map(function ($item, $key) use ($server) { $display = $server->variables->where('variable_id', $item->id)->pluck('variable_value')->first(); @@ -136,7 +137,7 @@ class RebuildServer extends Command $this->line("\n"); $results->each(function ($item, $key) use ($console) { - foreach($item['messages'] as $line) { + foreach ($item['messages'] as $line) { $console->{$item['status']}($line); } }); diff --git a/app/Http/Controllers/API/NodeController.php b/app/Http/Controllers/API/NodeController.php index c0df9cba0..6a03bdba1 100755 --- a/app/Http/Controllers/API/NodeController.php +++ b/app/Http/Controllers/API/NodeController.php @@ -32,7 +32,6 @@ use Dingo\Api\Exception\ResourceException; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Repositories\NodeRepository; use Pterodactyl\Exceptions\DisplayValidationException; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException; @@ -113,13 +112,13 @@ class NodeController extends BaseController return $node->toArray(); } - /** - * Returns a configuration file for a given node. - * - * @param Request $request - * @param int $id - * @return array - */ + /** + * Returns a configuration file for a given node. + * + * @param Request $request + * @param int $id + * @return array + */ public function config(Request $request, $id) { $node = Node::findOrFail($id); diff --git a/app/Http/Controllers/API/ServerController.php b/app/Http/Controllers/API/ServerController.php index 0e25c19a2..2dae6bcdc 100755 --- a/app/Http/Controllers/API/ServerController.php +++ b/app/Http/Controllers/API/ServerController.php @@ -31,7 +31,6 @@ use Dingo\Api\Exception\ResourceException; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Repositories\ServerRepository; use Pterodactyl\Exceptions\DisplayValidationException; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException; diff --git a/app/Http/Controllers/API/ServiceController.php b/app/Http/Controllers/API/ServiceController.php index 9402f4111..1916ef41c 100755 --- a/app/Http/Controllers/API/ServiceController.php +++ b/app/Http/Controllers/API/ServiceController.php @@ -26,7 +26,6 @@ namespace Pterodactyl\Http\Controllers\API; use Illuminate\Http\Request; use Pterodactyl\Models\Service; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; class ServiceController extends BaseController { diff --git a/app/Http/Controllers/API/UserController.php b/app/Http/Controllers/API/UserController.php index 1d35bcf48..981baef51 100755 --- a/app/Http/Controllers/API/UserController.php +++ b/app/Http/Controllers/API/UserController.php @@ -30,7 +30,6 @@ use Dingo\Api\Exception\ResourceException; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Repositories\UserRepository; use Pterodactyl\Exceptions\DisplayValidationException; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException; class UserController extends BaseController diff --git a/app/Http/Controllers/Admin/PackController.php b/app/Http/Controllers/Admin/PackController.php index 9d1e6e768..14d248dc8 100644 --- a/app/Http/Controllers/Admin/PackController.php +++ b/app/Http/Controllers/Admin/PackController.php @@ -202,7 +202,6 @@ class PackController extends Controller return response()->download($filename, 'pack-' . $pack->name . '.zip')->deleteFileAfterSend(true); } else { - $fp = fopen($filename, 'a+'); fwrite($fp, json_encode($json, JSON_PRETTY_PRINT)); fclose($fp); diff --git a/app/Models/User.php b/app/Models/User.php index 5dc828a35..9ec5b229d 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -116,6 +116,7 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac } $this->use_totp = ! $this->use_totp; + return $this->save(); } diff --git a/app/Repositories/Daemon/CommandRepository.php b/app/Repositories/Daemon/CommandRepository.php index d14895b3c..51afc6105 100644 --- a/app/Repositories/Daemon/CommandRepository.php +++ b/app/Repositories/Daemon/CommandRepository.php @@ -25,7 +25,6 @@ namespace Pterodactyl\Repositories\Daemon; use Pterodactyl\Models; -use GuzzleHttp\Exception\RequestException; use Pterodactyl\Exceptions\DisplayException; class CommandRepository diff --git a/app/Repositories/ServerRepository.php b/app/Repositories/ServerRepository.php index a9ebf2628..16d618edc 100644 --- a/app/Repositories/ServerRepository.php +++ b/app/Repositories/ServerRepository.php @@ -720,7 +720,7 @@ class ServerRepository } /** - * Queue a server for deletion + * Queue a server for deletion. * * @param int $id * @param bool $force diff --git a/app/Services/APILogService.php b/app/Services/APILogService.php index ce9fd56ee..c8e5c098c 100644 --- a/app/Services/APILogService.php +++ b/app/Services/APILogService.php @@ -31,7 +31,7 @@ use Pterodactyl\Models\APILog; class APILogService { /** - * Log an API Request + * Log an API Request. * * @param \Illuminate\Http\Request $request * @param null|string $error