Apply fixes from StyleCI (#331)

This commit is contained in:
Dane Everitt 2017-03-03 23:38:21 -05:00 committed by GitHub
parent e6d3663b3b
commit b1564389d8
5 changed files with 12 additions and 15 deletions

View File

@ -27,7 +27,6 @@ namespace Pterodactyl\Http\Controllers\Admin;
use DB; use DB;
use Log; use Log;
use Alert; use Alert;
use Carbon;
use Javascript; use Javascript;
use Pterodactyl\Models; use Pterodactyl\Models;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@ -206,7 +205,7 @@ class NodesController extends Controller
* Updates settings for a node. * Updates settings for a node.
* *
* @param Request $request * @param Request $request
* @param integer $node * @param int $node
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
*/ */
public function updateSettings(Request $request, $id) public function updateSettings(Request $request, $id)
@ -237,8 +236,8 @@ class NodesController extends Controller
* Removes a single allocation from a node. * Removes a single allocation from a node.
* *
* @param Request $request * @param Request $request
* @param integer $node * @param int $node
* @param integer $allocation [description] * @param int $allocation [description]
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/ */
public function allocationRemoveSingle(Request $request, $node, $allocation) 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. * Remove all allocations for a specific IP at once on a node.
* *
* @param Request $request * @param Request $request
* @param integer $node * @param int $node
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
*/ */
public function allocationRemoveBlock(Request $request, $node) public function allocationRemoveBlock(Request $request, $node)
@ -276,7 +275,7 @@ class NodesController extends Controller
* Sets an alias for a specific allocation on a node. * Sets an alias for a specific allocation on a node.
* *
* @param Request $request * @param Request $request
* @param integer $node * @param int $node
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
* @throws \Exception * @throws \Exception
*/ */
@ -301,7 +300,7 @@ class NodesController extends Controller
* Creates new allocations on a node. * Creates new allocations on a node.
* *
* @param Request $request * @param Request $request
* @param integer $node * @param int $node
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
*/ */
public function createAllocation(Request $request, $node) public function createAllocation(Request $request, $node)
@ -327,7 +326,7 @@ class NodesController extends Controller
* Deletes a node from the system. * Deletes a node from the system.
* *
* @param Request $request * @param Request $request
* @param integer $id * @param int $id
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
*/ */
public function delete(Request $request, $id) public function delete(Request $request, $id)
@ -353,7 +352,7 @@ class NodesController extends Controller
* Returns the configuration token to auto-deploy a node. * Returns the configuration token to auto-deploy a node.
* *
* @param Request $request * @param Request $request
* @param integer $id * @param int $id
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function setToken(Request $request, $id) public function setToken(Request $request, $id)

View File

@ -154,7 +154,7 @@ class ServersController extends Controller
try { try {
$server = new ServerRepository; $server = new ServerRepository;
$server->updateDetails($id, $request->intersect([ $server->updateDetails($id, $request->intersect([
'owner_id', 'name', 'reset_token' 'owner_id', 'name', 'reset_token',
])); ]));
Alert::success('Server details were successfully updated.')->flash(); Alert::success('Server details were successfully updated.')->flash();

View File

@ -179,7 +179,7 @@ class NodeRepository
/** /**
* Adds allocations to a provided node. * Adds allocations to a provided node.
* @param integer $id * @param int $id
* @param array $data * @param array $data
*/ */
public function addAllocations($id, array $data) public function addAllocations($id, array $data)
@ -204,7 +204,7 @@ class NodeRepository
} }
DB::transaction(function () use ($parsed, $node, $data) { 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) { foreach ($data['allocation_ports'] as $port) {
// Determine if this is a valid single port, or a valid port range. // 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)) { if (! ctype_digit($port) && ! preg_match('/^(\d{1,5})-(\d{1,5})$/', $port)) {

View File

@ -354,7 +354,7 @@ class ServerRepository
$validator = Validator::make($data, [ $validator = Validator::make($data, [
'owner_id' => 'sometimes|required|numeric|exists:users,id', 'owner_id' => 'sometimes|required|numeric|exists:users,id',
'name' => 'sometimes|required|regex:([\w .-]{1,200})', '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. // Run validator, throw catchable and displayable exception if it fails.

View File

@ -1,10 +1,8 @@
<?php <?php
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Pterodactyl\Models\NodeConfigurationToken;
class UpdateNodeConfigTokensColumns extends Migration class UpdateNodeConfigTokensColumns extends Migration
{ {