From b1564389d87cffc21240e7b0996cf15c189fa925 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Fri, 3 Mar 2017 23:38:21 -0500 Subject: [PATCH] Apply fixes from StyleCI (#331) --- app/Http/Controllers/Admin/NodesController.php | 17 ++++++++--------- .../Controllers/Admin/ServersController.php | 2 +- app/Repositories/NodeRepository.php | 4 ++-- app/Repositories/ServerRepository.php | 2 +- ..._03_224254_UpdateNodeConfigTokensColumns.php | 2 -- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/app/Http/Controllers/Admin/NodesController.php b/app/Http/Controllers/Admin/NodesController.php index bd795a71..4bb08c52 100644 --- a/app/Http/Controllers/Admin/NodesController.php +++ b/app/Http/Controllers/Admin/NodesController.php @@ -27,7 +27,6 @@ namespace Pterodactyl\Http\Controllers\Admin; use DB; use Log; use Alert; -use Carbon; use Javascript; use Pterodactyl\Models; use Illuminate\Http\Request; @@ -206,7 +205,7 @@ class NodesController extends Controller * Updates settings for a node. * * @param Request $request - * @param integer $node + * @param int $node * @return \Illuminate\Http\RedirectResponse */ public function updateSettings(Request $request, $id) @@ -237,8 +236,8 @@ class NodesController extends Controller * Removes a single allocation from a node. * * @param Request $request - * @param integer $node - * @param integer $allocation [description] + * @param int $node + * @param int $allocation [description] * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse */ public function allocationRemoveSingle(Request $request, $node, $allocation) @@ -257,7 +256,7 @@ class NodesController extends Controller * Remove all allocations for a specific IP at once on a node. * * @param Request $request - * @param integer $node + * @param int $node * @return \Illuminate\Http\RedirectResponse */ public function allocationRemoveBlock(Request $request, $node) @@ -276,7 +275,7 @@ class NodesController extends Controller * Sets an alias for a specific allocation on a node. * * @param Request $request - * @param integer $node + * @param int $node * @return \Illuminate\Http\Response * @throws \Exception */ @@ -301,7 +300,7 @@ class NodesController extends Controller * Creates new allocations on a node. * * @param Request $request - * @param integer $node + * @param int $node * @return \Illuminate\Http\RedirectResponse */ public function createAllocation(Request $request, $node) @@ -327,7 +326,7 @@ class NodesController extends Controller * Deletes a node from the system. * * @param Request $request - * @param integer $id + * @param int $id * @return \Illuminate\Http\RedirectResponse */ public function delete(Request $request, $id) @@ -353,7 +352,7 @@ class NodesController extends Controller * Returns the configuration token to auto-deploy a node. * * @param Request $request - * @param integer $id + * @param int $id * @return \Illuminate\Http\JsonResponse */ public function setToken(Request $request, $id) diff --git a/app/Http/Controllers/Admin/ServersController.php b/app/Http/Controllers/Admin/ServersController.php index 2f521804..0e217dcc 100644 --- a/app/Http/Controllers/Admin/ServersController.php +++ b/app/Http/Controllers/Admin/ServersController.php @@ -154,7 +154,7 @@ class ServersController extends Controller try { $server = new ServerRepository; $server->updateDetails($id, $request->intersect([ - 'owner_id', 'name', 'reset_token' + 'owner_id', 'name', 'reset_token', ])); Alert::success('Server details were successfully updated.')->flash(); diff --git a/app/Repositories/NodeRepository.php b/app/Repositories/NodeRepository.php index b51b9415..32b20699 100644 --- a/app/Repositories/NodeRepository.php +++ b/app/Repositories/NodeRepository.php @@ -179,7 +179,7 @@ class NodeRepository /** * Adds allocations to a provided node. - * @param integer $id + * @param int $id * @param array $data */ public function addAllocations($id, array $data) @@ -204,7 +204,7 @@ class NodeRepository } DB::transaction(function () use ($parsed, $node, $data) { - foreach(Network::parse(gethostbyname($data['allocation_ip'])) as $ip) { + foreach (Network::parse(gethostbyname($data['allocation_ip'])) as $ip) { foreach ($data['allocation_ports'] as $port) { // Determine if this is a valid single port, or a valid port range. if (! ctype_digit($port) && ! preg_match('/^(\d{1,5})-(\d{1,5})$/', $port)) { diff --git a/app/Repositories/ServerRepository.php b/app/Repositories/ServerRepository.php index 75697990..8d3bfa8d 100644 --- a/app/Repositories/ServerRepository.php +++ b/app/Repositories/ServerRepository.php @@ -354,7 +354,7 @@ class ServerRepository $validator = Validator::make($data, [ 'owner_id' => 'sometimes|required|numeric|exists:users,id', 'name' => 'sometimes|required|regex:([\w .-]{1,200})', - 'reset_token' => 'sometimes|required|accepted' + 'reset_token' => 'sometimes|required|accepted', ]); // Run validator, throw catchable and displayable exception if it fails. diff --git a/database/migrations/2017_03_03_224254_UpdateNodeConfigTokensColumns.php b/database/migrations/2017_03_03_224254_UpdateNodeConfigTokensColumns.php index 58dc78ba..5931518d 100644 --- a/database/migrations/2017_03_03_224254_UpdateNodeConfigTokensColumns.php +++ b/database/migrations/2017_03_03_224254_UpdateNodeConfigTokensColumns.php @@ -1,10 +1,8 @@