Skip to content

Commit 1897741

Browse files
committed
StyleCI cleanup
1 parent 37a723a commit 1897741

10 files changed

+17
-36
lines changed

app/Http/Controllers/Admin/OptionController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
use Log;
2828
use Alert;
29-
use Storage;
3029
use Javascript;
3130
use Illuminate\Http\Request;
3231
use Pterodactyl\Models\Service;
@@ -67,7 +66,7 @@ public function create(Request $request)
6766
$option = $repo->create($request->intersect([
6867
'service_id', 'name', 'description', 'tag',
6968
'docker_image', 'startup', 'config_from', 'config_startup',
70-
'config_logs', 'config_files', 'config_stop'
69+
'config_logs', 'config_files', 'config_stop',
7170
]));
7271
Alert::success('Successfully created new service option.')->flash();
7372

@@ -195,7 +194,7 @@ public function editVariable(Request $request, $option, $variable)
195194
Alert::success("The service variable '{$variable->name}' has been updated.")->flash();
196195
} else {
197196
$repo->delete($variable);
198-
Alert::success("That service variable has been deleted.")->flash();
197+
Alert::success('That service variable has been deleted.')->flash();
199198
}
200199
} catch (DisplayValidationException $ex) {
201200
return redirect()->route('admin.services.option.variables', $option)->withErrors(json_decode($ex->getMessage()));

app/Http/Controllers/Admin/ServiceController.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,4 @@ public function edit(Request $request, $id)
149149

150150
return redirect()->route($redirectTo, $id);
151151
}
152-
153-
/**
154-
* Edits function file for a service.
155-
*
156-
* @param Request $request
157-
* @param int $id
158-
* @return \Illuminate\Response\RedirectResponse
159-
*/
160-
public function editFunctions(Request $request, $id)
161-
{
162-
163-
}
164152
}

app/Http/Controllers/Daemon/ServiceController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function pull(Request $request, $folder, $file)
6666

6767
if ($file === 'index.js') {
6868
return response($service->index_file)->header('Content-Type', 'text/plain');
69-
} else if ($file === 'main.json') {
69+
} elseif ($file === 'main.json') {
7070
return response()->json($this->getConfiguration($service->id));
7171
}
7272

app/Models/Service.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Service extends Model
5151
*/
5252
public function defaultIndexFile()
5353
{
54-
return <<<EOF
54+
return <<<'EOF'
5555
'use strict';
5656
5757
/**

app/Repositories/OptionRepository.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
use Validator;
2929
use Pterodactyl\Models\ServiceOption;
3030
use Pterodactyl\Exceptions\DisplayException;
31-
use Pterodactyl\Repositories\VariableRepository;
3231
use Pterodactyl\Exceptions\DisplayValidationException;
3332

3433
class OptionRepository

app/Repositories/ServiceRepository.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,9 @@
2525
namespace Pterodactyl\Repositories;
2626

2727
use DB;
28-
use Uuid;
2928
use Validator;
3029
use Pterodactyl\Models\Service;
31-
use Pterodactyl\Models\ServiceVariable;
3230
use Pterodactyl\Exceptions\DisplayException;
33-
use Pterodactyl\Repositories\OptionRepository;
3431
use Pterodactyl\Exceptions\DisplayValidationException;
3532

3633
class ServiceRepository
@@ -122,7 +119,7 @@ public function delete($id)
122119
}
123120

124121
DB::transaction(function () use ($service) {
125-
foreach($service->options as $option) {
122+
foreach ($service->options as $option) {
126123
(new OptionRepository)->delete($option->id);
127124
}
128125

database/migrations/2017_03_10_162934_AddNewServiceOptionsColumns.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class AddNewServiceOptionsColumns extends Migration
1313
*/
1414
public function up()
1515
{
16-
DB::transaction(function() {
16+
DB::transaction(function () {
1717
Schema::table('service_options', function (Blueprint $table) {
1818
$table->dropColumn('executable');
1919

@@ -35,7 +35,7 @@ public function up()
3535
*/
3636
public function down()
3737
{
38-
DB::transaction(function() {
38+
DB::transaction(function () {
3939
Schema::table('service_options', function (Blueprint $table) {
4040
$table->dropForeign('config_from');
4141

database/migrations/2017_03_10_173607_MigrateToNewServiceSystem.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
*/
2424
use Pterodactyl\Models\Service;
2525
use Pterodactyl\Models\ServiceOption;
26-
use Illuminate\Support\Facades\Schema;
27-
use Illuminate\Database\Schema\Blueprint;
2826
use Illuminate\Database\Migrations\Migration;
2927

3028
class MigrateToNewServiceSystem extends Migration
@@ -69,7 +67,7 @@ public function minecraft()
6967
DB::transaction(function () use ($service) {
7068
$options = ServiceOption::where('service_id', $service->id)->get();
7169
$options->each(function ($item) use ($options) {
72-
switch($item->tag) {
70+
switch ($item->tag) {
7371
case 'vanilla':
7472
$item->config_startup = '{"done": ")! For help, type ", "userInteraction": [ "Go to eula.txt for more info."]}';
7573
$item->config_files = '{"server.properties":{"parser": "properties", "find":{"server-ip": "0.0.0.0", "enable-query": "true", "server-port": "{{server.build.default.port}}", "query.port": "{{server.build.default.port}}"}}}';
@@ -117,13 +115,13 @@ public function srcds()
117115
$options->each(function ($item) use ($options) {
118116
if ($item->tag === 'srcds' && $item->name === 'Insurgency') {
119117
$item->tag = 'insurgency';
120-
} else if ($item->tag === 'srcds' && $item->name === 'Team Fortress 2') {
118+
} elseif ($item->tag === 'srcds' && $item->name === 'Team Fortress 2') {
121119
$item->tag = 'tf2';
122-
} else if ($item->tag === 'srcds' && $item->name === 'Custom Source Engine Game') {
120+
} elseif ($item->tag === 'srcds' && $item->name === 'Custom Source Engine Game') {
123121
$item->tag = 'source';
124122
}
125123

126-
switch($item->tag) {
124+
switch ($item->tag) {
127125
case 'source':
128126
$item->config_startup = '{"done": "Assigned anonymous gameserver", "userInteraction": []}';
129127
$item->config_files = '{}';
@@ -164,7 +162,7 @@ public function terraria()
164162
DB::transaction(function () use ($service) {
165163
$options = ServiceOption::where('service_id', $service->id)->get();
166164
$options->each(function ($item) use ($options) {
167-
switch($item->tag) {
165+
switch ($item->tag) {
168166
case 'tshock':
169167
$item->startup = null;
170168
$item->config_startup = '{"done": "Type \'help\' for a list of commands", "userInteraction": []}';
@@ -195,7 +193,7 @@ public function voice()
195193
DB::transaction(function () use ($service) {
196194
$options = ServiceOption::where('service_id', $service->id)->get();
197195
$options->each(function ($item) use ($options) {
198-
switch($item->tag) {
196+
switch ($item->tag) {
199197
case 'mumble':
200198
$item->startup = './murmur.x86 -fg';
201199
$item->config_startup = '{"done": "Server listening on", "userInteraction": [ "Generating new server certificate"]}';

database/migrations/2017_03_11_215455_ChangeServiceVariablesValidationRules.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function up()
1919
});
2020

2121
DB::transaction(function () {
22-
foreach(ServiceVariable::all() as $variable) {
22+
foreach (ServiceVariable::all() as $variable) {
2323
$variable->rules = ($variable->required) ? 'required|regex:' . $variable->rules : 'regex:' . $variable->regex;
2424
$variable->save();
2525
}
@@ -38,7 +38,7 @@ public function down()
3838
});
3939

4040
DB::transaction(function () {
41-
foreach(ServiceVariable::all() as $variable) {
41+
foreach (ServiceVariable::all() as $variable) {
4242
$variable->regex = str_replace(['required|regex:', 'regex:'], '', $variable->regex);
4343
$variable->save();
4444
}

database/migrations/2017_03_12_150648_MoveFunctionsFromFileToDatabase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class MoveFunctionsFromFileToDatabase extends Migration
99
{
1010

11-
private $default = <<<EOF
11+
private $default = <<<'EOF'
1212
'use strict';
1313
1414
/**
@@ -43,7 +43,7 @@ class Service extends Core {}
4343
module.exports = Service;
4444
EOF;
4545

46-
private $default_mc = <<<EOF
46+
private $default_mc = <<<'EOF'
4747
'use strict';
4848
4949
/**

0 commit comments

Comments
 (0)