Skip to content

Commit 34ffaeb

Browse files
committed
Run cs-fix, ensure we only install dependency versions supporting 7.4+
1 parent 3e55a79 commit 34ffaeb

16 files changed

+154
-290
lines changed

.gitignore

+1-10
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,17 @@ node_modules
1515
_ide_helper.php
1616
_ide_helper_models.php
1717
.phpstorm.meta.php
18-
.php_cs.cache
1918
.yarn
2019
public/assets/manifest.json
2120

2221
# For local development with docker
2322
# Remove if we ever put the Dockerfile in the repo
2423
.dockerignore
25-
#Dockerfile
2624
docker-compose.yml
2725

2826
# for image related files
2927
misc
30-
.phpstorm.meta.php
31-
.php_cs.cache
32-
28+
.php-cs-fixer.cache
3329
coverage.xml
34-
35-
# Vagrant
36-
*.log
3730
resources/lang/locales.js
38-
resources/assets/pterodactyl/scripts/helpers/ziggy.js
39-
resources/assets/scripts/helpers/ziggy.js
4031
.phpunit.result.cache

.php-cs-fixer.dist.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
'no_unreachable_default_argument_value' => true,
3030
'no_useless_return' => true,
3131
'ordered_imports' => [
32-
'sortAlgorithm' => 'length',
32+
'sort_algorithm' => 'length',
3333
],
3434
'phpdoc_align' => [
3535
'align' => 'left',

app/Console/Commands/Environment/AppSettingsCommand.php

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public function handle()
114114
foreach ($validator->errors()->all() as $error) {
115115
$this->output->error($error);
116116
}
117+
117118
return 1;
118119
}
119120

app/Console/Commands/Node/MakeNodeCommand.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class MakeNodeCommand extends Command
4646
*/
4747
protected $description = 'Creates a new node on the system via the CLI.';
4848

49-
5049
/**
5150
* Handle the command execution process.
5251
*
@@ -62,13 +61,18 @@ public function handle(NodeCreationService $creationService)
6261
$data['fqdn'] = $this->option('fqdn') ?? $this->ask('Enter a domain name (e.g node.example.com) to be used for connecting to the daemon. An IP address may only be used if you are not using SSL for this node');
6362
if (!filter_var(gethostbyname($data['fqdn']), FILTER_VALIDATE_IP)) {
6463
$this->error('The FQDN or IP address provided does not resolve to a valid IP address.');
64+
6565
return;
6666
}
6767
$data['public'] = $this->option('public') ?? $this->confirm('Should this node be public? As a note, setting a node to private you will be denying the ability to auto-deploy to this node.', true);
68-
$data['scheme'] = $this->option('scheme') ?? $this->anticipate('Please either enter https for SSL or http for a non-ssl connection',
69-
["https","http",],"https");
68+
$data['scheme'] = $this->option('scheme') ?? $this->anticipate(
69+
'Please either enter https for SSL or http for a non-ssl connection',
70+
['https', 'http'],
71+
'https'
72+
);
7073
if (filter_var($data['fqdn'], FILTER_VALIDATE_IP) && $data['scheme'] === 'https') {
7174
$this->error('A fully qualified domain name that resolves to a public IP address is required in order to use SSL for this node.');
75+
7276
return;
7377
}
7478
$data['behind_proxy'] = $this->option('proxy') ?? $this->confirm('Is your FQDN behind a proxy?');

app/Console/Commands/Schedule/ProcessRunnableCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected function processSchedule(Schedule $schedule)
6969
'schedule' => $schedule->name,
7070
'hash' => $schedule->hashid,
7171
]));
72-
} catch (Throwable | Exception $exception) {
72+
} catch (Throwable|Exception $exception) {
7373
Log::error($exception, ['schedule_id' => $schedule->id]);
7474

7575
$this->error("An error was encountered while processing Schedule #{$schedule->id}: " . $exception->getMessage());

app/Console/Commands/UpgradeCommand.php

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public function handle()
8787

8888
if (!$this->confirm('Are you sure you want to run the upgrade process for your Panel?')) {
8989
$this->warn('Upgrade process terminated by user.');
90+
9091
return;
9192
}
9293
}

app/Http/Controllers/Api/Remote/Servers/ServerTransferController.php

-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ public function failure(string $uuid)
128128
/**
129129
* The daemon notifies us about a transfer success.
130130
*
131-
* @return \Illuminate\Http\JsonResponse
132-
*
133131
* @throws \Throwable
134132
*/
135133
public function success(string $uuid): JsonResponse

app/Http/Controllers/Auth/AbstractLoginController.php

-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ protected function sendLoginResponse(User $user, Request $request): JsonResponse
9292

9393
/**
9494
* Determine if the user is logging in using an email or username,.
95-
*
96-
* @param string|null $input
97-
* @return string
9895
*/
9996
protected function getField(string $input = null): string
10097
{

app/Http/Controllers/Auth/LoginCheckpointController.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Pterodactyl\Http\Controllers\Auth;
44

5-
use Carbon\CarbonInterface;
65
use Carbon\CarbonImmutable;
6+
use Carbon\CarbonInterface;
77
use Pterodactyl\Models\User;
88
use Illuminate\Http\JsonResponse;
99
use PragmaRX\Google2FA\Google2FA;
@@ -110,9 +110,6 @@ protected function isValidRecoveryToken(User $user, string $value)
110110
* Determines if the data provided from the session is valid or not. This
111111
* will return false if the data is invalid, or if more time has passed than
112112
* was configured when the session was written.
113-
*
114-
* @param array $data
115-
* @return bool
116113
*/
117114
protected function hasValidSessionData(array $data): bool
118115
{

app/Http/Middleware/VerifyCsrfToken.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class VerifyCsrfToken extends BaseVerifier
2828
* to using Sanctum for the API endpoints, which handles that for us automatically.
2929
*
3030
* @param \Illuminate\Http\Request $request
31-
* @param \Closure $next
31+
*
3232
* @return mixed
3333
*
3434
* @throws \Illuminate\Session\TokenMismatchException

app/Services/Servers/BuildModificationService.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class BuildModificationService
3333
* BuildModificationService constructor.
3434
*
3535
* @param \Pterodactyl\Services\Servers\ServerConfigurationStructureService $structureService
36-
* @param \Illuminate\Database\ConnectionInterface $connection
37-
* @param \Pterodactyl\Repositories\Wings\DaemonServerRepository $daemonServerRepository
3836
*/
3937
public function __construct(
4038
ServerConfigurationStructureService $structureService,
@@ -57,7 +55,7 @@ public function __construct(
5755
public function handle(Server $server, array $data)
5856
{
5957
/** @var \Pterodactyl\Models\Server $server */
60-
$server = $this->connection->transaction(function() use ($server, $data) {
58+
$server = $this->connection->transaction(function () use ($server, $data) {
6159
$this->processAllocations($server, $data);
6260

6361
if (isset($data['allocation_id']) && $data['allocation_id'] != $server->allocation_id) {

composer.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"barryvdh/laravel-ide-helper": "^2.12",
4848
"facade/ignition": "^2.17",
4949
"fakerphp/faker": "^1.19",
50-
"friendsofphp/php-cs-fixer": "^2.19",
50+
"friendsofphp/php-cs-fixer": "^3.8",
5151
"laravel/dusk": "^6.23",
5252
"mockery/mockery": "^1.5",
5353
"nunomaduro/collision": "^5.11",
@@ -70,7 +70,8 @@
7070
}
7171
},
7272
"scripts": {
73-
"php-cs-fixer": "php-cs-fixer fix --diff --diff-format=udiff --config=./.php_cs.dist",
73+
"cs:fix": "php-cs-fixer fix",
74+
"cs:check": "php-cs-fixer fix --dry-run --diff --verbose",
7475
"post-root-package-install": [
7576
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
7677
],
@@ -84,6 +85,9 @@
8485
},
8586
"prefer-stable": true,
8687
"config": {
88+
"platform": {
89+
"php": "7.4.0"
90+
},
8791
"preferred-install": "dist",
8892
"sort-packages": true,
8993
"optimize-autoloader": false

0 commit comments

Comments
 (0)