Use more standardized phpcs
This commit is contained in:
parent
a043071e3c
commit
c449ca5155
493 changed files with 1116 additions and 3903 deletions
|
@ -16,8 +16,6 @@ class AllocationFactory extends Factory
|
|||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
|
|
@ -18,8 +18,6 @@ class ApiKeyFactory extends Factory
|
|||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
|
|
@ -17,8 +17,6 @@ class BackupFactory extends Factory
|
|||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
|
|
@ -18,8 +18,6 @@ class DatabaseFactory extends Factory
|
|||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
|
|
@ -17,8 +17,6 @@ class DatabaseHostFactory extends Factory
|
|||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
|
|
@ -17,8 +17,6 @@ class EggFactory extends Factory
|
|||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
|
|
@ -17,8 +17,6 @@ class EggVariableFactory extends Factory
|
|||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
@ -35,8 +33,6 @@ class EggVariableFactory extends Factory
|
|||
|
||||
/**
|
||||
* Indicate that the egg variable is viewable.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
||||
*/
|
||||
public function viewable(): Factory
|
||||
{
|
||||
|
@ -49,8 +45,6 @@ class EggVariableFactory extends Factory
|
|||
|
||||
/**
|
||||
* Indicate that the egg variable is editable.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
||||
*/
|
||||
public function editable(): Factory
|
||||
{
|
||||
|
|
|
@ -17,8 +17,6 @@ class LocationFactory extends Factory
|
|||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
|
|
@ -17,8 +17,6 @@ class NestFactory extends Factory
|
|||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
|
|
@ -19,8 +19,6 @@ class NodeFactory extends Factory
|
|||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
|
|
@ -16,8 +16,6 @@ class ScheduleFactory extends Factory
|
|||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
|
|
@ -17,8 +17,6 @@ class SubuserFactory extends Factory
|
|||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
|
|
@ -16,8 +16,6 @@ class TaskFactory extends Factory
|
|||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
|
|
@ -18,8 +18,6 @@ class UserFactory extends Factory
|
|||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
|
@ -43,8 +41,6 @@ class UserFactory extends Factory
|
|||
|
||||
/**
|
||||
* Indicate that the user is an admin.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
||||
*/
|
||||
public function admin(): Factory
|
||||
{
|
||||
|
|
|
@ -42,12 +42,6 @@ class EggSeeder extends Seeder
|
|||
|
||||
/**
|
||||
* EggSeeder constructor.
|
||||
*
|
||||
* @param \Pterodactyl\Services\Eggs\Sharing\EggImporterService $importerService
|
||||
* @param \Pterodactyl\Contracts\Repository\EggRepositoryInterface $repository
|
||||
* @param \Pterodactyl\Services\Eggs\Sharing\EggUpdateImporterService $updateImporterService
|
||||
* @param \Illuminate\Filesystem\Filesystem $filesystem
|
||||
* @param \Pterodactyl\Contracts\Repository\NestRepositoryInterface $nestRepository
|
||||
*/
|
||||
public function __construct(
|
||||
EggImporterService $importerService,
|
||||
|
@ -75,8 +69,6 @@ class EggSeeder extends Seeder
|
|||
|
||||
/**
|
||||
* Return a list of eggs to import.
|
||||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
protected function getEggsToImport(): Collection
|
||||
{
|
||||
|
@ -91,9 +83,6 @@ class EggSeeder extends Seeder
|
|||
/**
|
||||
* Find the nest that these eggs should be attached to.
|
||||
*
|
||||
* @param string $nestName
|
||||
* @return \Pterodactyl\Models\Nest
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
private function findMatchingNest(string $nestName): Nest
|
||||
|
@ -106,8 +95,6 @@ class EggSeeder extends Seeder
|
|||
|
||||
/**
|
||||
* Loop through the list of egg files and import them.
|
||||
*
|
||||
* @param \Pterodactyl\Models\Nest $nest
|
||||
*/
|
||||
private function parseEggFiles(Nest $nest)
|
||||
{
|
||||
|
|
|
@ -20,9 +20,6 @@ class NestSeeder extends Seeder
|
|||
|
||||
/**
|
||||
* NestSeeder constructor.
|
||||
*
|
||||
* @param \Pterodactyl\Services\Nests\NestCreationService $creationService
|
||||
* @param \Pterodactyl\Contracts\Repository\NestRepositoryInterface $repository
|
||||
*/
|
||||
public function __construct(
|
||||
NestCreationService $creationService,
|
||||
|
@ -52,8 +49,6 @@ class NestSeeder extends Seeder
|
|||
/**
|
||||
* Create the Minecraft nest to be used later on.
|
||||
*
|
||||
* @param array|null $nest
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
*/
|
||||
private function createMinecraftNest(array $nest = null)
|
||||
|
@ -69,8 +64,6 @@ class NestSeeder extends Seeder
|
|||
/**
|
||||
* Create the Source Engine Games nest to be used later on.
|
||||
*
|
||||
* @param array|null $nest
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
*/
|
||||
private function createSourceEngineNest(array $nest = null)
|
||||
|
@ -86,8 +79,6 @@ class NestSeeder extends Seeder
|
|||
/**
|
||||
* Create the Voice Servers nest to be used later on.
|
||||
*
|
||||
* @param array|null $nest
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
*/
|
||||
private function createVoiceServersNest(array $nest = null)
|
||||
|
@ -103,8 +94,6 @@ class NestSeeder extends Seeder
|
|||
/**
|
||||
* Create the Rust nest to be used later on.
|
||||
*
|
||||
* @param array|null $nest
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
*/
|
||||
private function createRustNest(array $nest = null)
|
||||
|
|
|
@ -13,7 +13,7 @@ class AddArkServiceOptionFixed extends Migration
|
|||
$service = DB::table('services')->select('id')->where('author', 'ptrdctyl-v040-11e6-8b77-86f30ca893d3')->where('name', 'Source Engine')->first();
|
||||
|
||||
// No SRCDS Service, Skipping
|
||||
if (! $service) {
|
||||
if (!$service) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class MigrateToNewServiceSystem extends Migration
|
|||
{
|
||||
DB::transaction(function () {
|
||||
$service = DB::table('services')->where('author', config('pterodactyl.service.core'))->where('folder', 'srcds')->first();
|
||||
if (! $service) {
|
||||
if (!$service) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class UpdateOldPermissionsToPointToNewScheduleSystem extends Migration
|
|||
$permissions = DB::table('permissions')->where('permission', 'like', '%-task%')->get();
|
||||
foreach ($permissions as $record) {
|
||||
$parts = explode('-', $record->permission);
|
||||
if (! in_array(array_get($parts, 1), ['tasks', 'task']) || count($parts) !== 2) {
|
||||
if (!in_array(array_get($parts, 1), ['tasks', 'task']) || count($parts) !== 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ class UpdateOldPermissionsToPointToNewScheduleSystem extends Migration
|
|||
$permissions = DB::table('permissions')->where('permission', 'like', '%-schedule%')->get();
|
||||
foreach ($permissions as $record) {
|
||||
$parts = explode('-', $record->permission);
|
||||
if (! in_array(array_get($parts, 1), ['schedules', 'schedule']) || count($parts) !== 2) {
|
||||
if (!in_array(array_get($parts, 1), ['schedules', 'schedule']) || count($parts) !== 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ class SetupTableForKeyEncryption extends Migration
|
|||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws \Throwable
|
||||
*/
|
||||
|
@ -29,6 +30,7 @@ class SetupTableForKeyEncryption extends Migration
|
|||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws \Throwable
|
||||
*/
|
||||
|
|
|
@ -83,7 +83,7 @@ class MergePermissionsTableIntoSubusers extends Migration
|
|||
->map(function ($value) {
|
||||
return self::$permissionsMap[$value] ?? null;
|
||||
})->filter(function ($value) {
|
||||
return ! is_null($value) && $value !== Permission::ACTION_WEBSOCKET_CONNECT;
|
||||
return !is_null($value) && $value !== Permission::ACTION_WEBSOCKET_CONNECT;
|
||||
})
|
||||
// All subusers get this permission, so make sure it gets pushed into the array.
|
||||
->merge([Permission::ACTION_WEBSOCKET_CONNECT])
|
||||
|
@ -109,13 +109,13 @@ class MergePermissionsTableIntoSubusers extends Migration
|
|||
$values = [];
|
||||
foreach (json_decode($datum->permissions, true) as $permission) {
|
||||
$v = $flipped[$permission] ?? null;
|
||||
if (! empty($v)) {
|
||||
if (!empty($v)) {
|
||||
$values[] = $datum->id;
|
||||
$values[] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($values)) {
|
||||
if (!empty($values)) {
|
||||
$string = 'VALUES ' . implode(', ', array_fill(0, count($values) / 2, '(?, ?)'));
|
||||
|
||||
DB::insert('INSERT INTO permissions(`subuser_id`, `permission`) ' . $string, $values);
|
||||
|
|
|
@ -14,6 +14,7 @@ class StoreNodeTokensAsEncryptedValue extends Migration
|
|||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function up()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue