Skip to content

Commit b156438

Browse files
authored
Apply fixes from StyleCI (pterodactyl#331)
1 parent e6d3663 commit b156438

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

app/Http/Controllers/Admin/NodesController.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
use DB;
2828
use Log;
2929
use Alert;
30-
use Carbon;
3130
use Javascript;
3231
use Pterodactyl\Models;
3332
use Illuminate\Http\Request;
@@ -206,7 +205,7 @@ public function viewServers(Request $request, $id)
206205
* Updates settings for a node.
207206
*
208207
* @param Request $request
209-
* @param integer $node
208+
* @param int $node
210209
* @return \Illuminate\Http\RedirectResponse
211210
*/
212211
public function updateSettings(Request $request, $id)
@@ -237,8 +236,8 @@ public function updateSettings(Request $request, $id)
237236
* Removes a single allocation from a node.
238237
*
239238
* @param Request $request
240-
* @param integer $node
241-
* @param integer $allocation [description]
239+
* @param int $node
240+
* @param int $allocation [description]
242241
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
243242
*/
244243
public function allocationRemoveSingle(Request $request, $node, $allocation)
@@ -257,7 +256,7 @@ public function allocationRemoveSingle(Request $request, $node, $allocation)
257256
* Remove all allocations for a specific IP at once on a node.
258257
*
259258
* @param Request $request
260-
* @param integer $node
259+
* @param int $node
261260
* @return \Illuminate\Http\RedirectResponse
262261
*/
263262
public function allocationRemoveBlock(Request $request, $node)
@@ -276,7 +275,7 @@ public function allocationRemoveBlock(Request $request, $node)
276275
* Sets an alias for a specific allocation on a node.
277276
*
278277
* @param Request $request
279-
* @param integer $node
278+
* @param int $node
280279
* @return \Illuminate\Http\Response
281280
* @throws \Exception
282281
*/
@@ -301,7 +300,7 @@ public function allocationSetAlias(Request $request, $node)
301300
* Creates new allocations on a node.
302301
*
303302
* @param Request $request
304-
* @param integer $node
303+
* @param int $node
305304
* @return \Illuminate\Http\RedirectResponse
306305
*/
307306
public function createAllocation(Request $request, $node)
@@ -327,7 +326,7 @@ public function createAllocation(Request $request, $node)
327326
* Deletes a node from the system.
328327
*
329328
* @param Request $request
330-
* @param integer $id
329+
* @param int $id
331330
* @return \Illuminate\Http\RedirectResponse
332331
*/
333332
public function delete(Request $request, $id)
@@ -353,7 +352,7 @@ public function delete(Request $request, $id)
353352
* Returns the configuration token to auto-deploy a node.
354353
*
355354
* @param Request $request
356-
* @param integer $id
355+
* @param int $id
357356
* @return \Illuminate\Http\JsonResponse
358357
*/
359358
public function setToken(Request $request, $id)

app/Http/Controllers/Admin/ServersController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function postUpdateServerDetails(Request $request, $id)
154154
try {
155155
$server = new ServerRepository;
156156
$server->updateDetails($id, $request->intersect([
157-
'owner_id', 'name', 'reset_token'
157+
'owner_id', 'name', 'reset_token',
158158
]));
159159

160160
Alert::success('Server details were successfully updated.')->flash();

app/Repositories/NodeRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function update($id, array $data)
179179

180180
/**
181181
* Adds allocations to a provided node.
182-
* @param integer $id
182+
* @param int $id
183183
* @param array $data
184184
*/
185185
public function addAllocations($id, array $data)
@@ -204,7 +204,7 @@ public function addAllocations($id, array $data)
204204
}
205205

206206
DB::transaction(function () use ($parsed, $node, $data) {
207-
foreach(Network::parse(gethostbyname($data['allocation_ip'])) as $ip) {
207+
foreach (Network::parse(gethostbyname($data['allocation_ip'])) as $ip) {
208208
foreach ($data['allocation_ports'] as $port) {
209209
// Determine if this is a valid single port, or a valid port range.
210210
if (! ctype_digit($port) && ! preg_match('/^(\d{1,5})-(\d{1,5})$/', $port)) {

app/Repositories/ServerRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ public function updateDetails($id, array $data)
354354
$validator = Validator::make($data, [
355355
'owner_id' => 'sometimes|required|numeric|exists:users,id',
356356
'name' => 'sometimes|required|regex:([\w .-]{1,200})',
357-
'reset_token' => 'sometimes|required|accepted'
357+
'reset_token' => 'sometimes|required|accepted',
358358
]);
359359

360360
// Run validator, throw catchable and displayable exception if it fails.

database/migrations/2017_03_03_224254_UpdateNodeConfigTokensColumns.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<?php
22

3-
use Illuminate\Support\Facades\Hash;
43
use Illuminate\Support\Facades\Schema;
54
use Illuminate\Database\Schema\Blueprint;
65
use Illuminate\Database\Migrations\Migration;
7-
use Pterodactyl\Models\NodeConfigurationToken;
86

97
class UpdateNodeConfigTokensColumns extends Migration
108
{

0 commit comments

Comments
 (0)