Merge pull request #354 from Pterodactyl/analysis-zeLNpe

Apply fixes from StyleCI
This commit is contained in:
Dane Everitt 2017-03-19 19:52:20 -04:00 committed by GitHub
commit 769b723913
10 changed files with 13 additions and 17 deletions

View file

@ -72,6 +72,7 @@ class RebuildServer extends Command
$servers = Server::where('id', $this->option('server'))->get(); $servers = Server::where('id', $this->option('server'))->get();
} else { } else {
$this->error('You must pass a flag to determine which server(s) to rebuild.'); $this->error('You must pass a flag to determine which server(s) to rebuild.');
return; return;
} }
@ -80,7 +81,7 @@ class RebuildServer extends Command
$this->line('Beginning processing, do not exit this script.'); $this->line('Beginning processing, do not exit this script.');
$bar = $this->output->createProgressBar(count($servers)); $bar = $this->output->createProgressBar(count($servers));
$results = collect([]); $results = collect([]);
foreach($servers as $server) { foreach ($servers as $server) {
try { try {
$environment = $server->option->variables->map(function ($item, $key) use ($server) { $environment = $server->option->variables->map(function ($item, $key) use ($server) {
$display = $server->variables->where('variable_id', $item->id)->pluck('variable_value')->first(); $display = $server->variables->where('variable_id', $item->id)->pluck('variable_value')->first();
@ -136,7 +137,7 @@ class RebuildServer extends Command
$this->line("\n"); $this->line("\n");
$results->each(function ($item, $key) use ($console) { $results->each(function ($item, $key) use ($console) {
foreach($item['messages'] as $line) { foreach ($item['messages'] as $line) {
$console->{$item['status']}($line); $console->{$item['status']}($line);
} }
}); });

View file

@ -32,7 +32,6 @@ use Dingo\Api\Exception\ResourceException;
use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Exceptions\DisplayException;
use Pterodactyl\Repositories\NodeRepository; use Pterodactyl\Repositories\NodeRepository;
use Pterodactyl\Exceptions\DisplayValidationException; use Pterodactyl\Exceptions\DisplayValidationException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException; use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;
@ -113,13 +112,13 @@ class NodeController extends BaseController
return $node->toArray(); return $node->toArray();
} }
/** /**
* Returns a configuration file for a given node. * Returns a configuration file for a given node.
* *
* @param Request $request * @param Request $request
* @param int $id * @param int $id
* @return array * @return array
*/ */
public function config(Request $request, $id) public function config(Request $request, $id)
{ {
$node = Node::findOrFail($id); $node = Node::findOrFail($id);

View file

@ -31,7 +31,6 @@ use Dingo\Api\Exception\ResourceException;
use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Exceptions\DisplayException;
use Pterodactyl\Repositories\ServerRepository; use Pterodactyl\Repositories\ServerRepository;
use Pterodactyl\Exceptions\DisplayValidationException; use Pterodactyl\Exceptions\DisplayValidationException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException; use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;

View file

@ -26,7 +26,6 @@ namespace Pterodactyl\Http\Controllers\API;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Pterodactyl\Models\Service; use Pterodactyl\Models\Service;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class ServiceController extends BaseController class ServiceController extends BaseController
{ {

View file

@ -30,7 +30,6 @@ use Dingo\Api\Exception\ResourceException;
use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Exceptions\DisplayException;
use Pterodactyl\Repositories\UserRepository; use Pterodactyl\Repositories\UserRepository;
use Pterodactyl\Exceptions\DisplayValidationException; use Pterodactyl\Exceptions\DisplayValidationException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException; use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;
class UserController extends BaseController class UserController extends BaseController

View file

@ -202,7 +202,6 @@ class PackController extends Controller
return response()->download($filename, 'pack-' . $pack->name . '.zip')->deleteFileAfterSend(true); return response()->download($filename, 'pack-' . $pack->name . '.zip')->deleteFileAfterSend(true);
} else { } else {
$fp = fopen($filename, 'a+'); $fp = fopen($filename, 'a+');
fwrite($fp, json_encode($json, JSON_PRETTY_PRINT)); fwrite($fp, json_encode($json, JSON_PRETTY_PRINT));
fclose($fp); fclose($fp);

View file

@ -116,6 +116,7 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
} }
$this->use_totp = ! $this->use_totp; $this->use_totp = ! $this->use_totp;
return $this->save(); return $this->save();
} }

View file

@ -25,7 +25,6 @@
namespace Pterodactyl\Repositories\Daemon; namespace Pterodactyl\Repositories\Daemon;
use Pterodactyl\Models; use Pterodactyl\Models;
use GuzzleHttp\Exception\RequestException;
use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Exceptions\DisplayException;
class CommandRepository class CommandRepository

View file

@ -720,7 +720,7 @@ class ServerRepository
} }
/** /**
* Queue a server for deletion * Queue a server for deletion.
* *
* @param int $id * @param int $id
* @param bool $force * @param bool $force

View file

@ -31,7 +31,7 @@ use Pterodactyl\Models\APILog;
class APILogService class APILogService
{ {
/** /**
* Log an API Request * Log an API Request.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @param null|string $error * @param null|string $error