You've already forked Atomcms-edit
chore: fix code style with Laravel Pint
This commit is contained in:
@@ -123,6 +123,7 @@ class CheckMigrationsCommand extends Command
|
||||
$this->warn("[Orphaned] {$file->getFilename()} modifies table `{$table}` which no longer exists.");
|
||||
$this->warnings++;
|
||||
$this->addFileToDelete($file->getFilename());
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ use App\Services\RconService;
|
||||
use App\Services\SettingsService;
|
||||
use App\Services\UpdateHistoryService;
|
||||
use BackedEnum;
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Components\Placeholder;
|
||||
@@ -31,6 +30,7 @@ use Filament\Notifications\Notification;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -67,7 +67,7 @@ final class Commandocentrum extends Page implements HasForms
|
||||
|
||||
public string $catalogSyncUrl = '';
|
||||
|
||||
/** @var array<\App\Services\Diagnostics\DiagnosticResult> */
|
||||
/** @var array<DiagnosticResult> */
|
||||
public array $diagnostics = [];
|
||||
|
||||
public function mount(): void
|
||||
@@ -421,7 +421,7 @@ final class Commandocentrum extends Page implements HasForms
|
||||
]);
|
||||
}
|
||||
|
||||
private function renderServerInfoView(): \Illuminate\Contracts\View\View
|
||||
private function renderServerInfoView(): View
|
||||
{
|
||||
$load = sys_getloadavg();
|
||||
|
||||
@@ -438,7 +438,7 @@ final class Commandocentrum extends Page implements HasForms
|
||||
]);
|
||||
}
|
||||
|
||||
private function renderHotelStatusView(): \Illuminate\Contracts\View\View
|
||||
private function renderHotelStatusView(): View
|
||||
{
|
||||
$serviceName = $this->getSetting('emulator_service_name', 'emulator');
|
||||
$serviceStatus = $this->runCommand('systemctl is-active ' . escapeshellarg($serviceName) . ' 2>/dev/null') ?: 'inactive';
|
||||
@@ -479,7 +479,7 @@ final class Commandocentrum extends Page implements HasForms
|
||||
]);
|
||||
}
|
||||
|
||||
private function renderEmulatorInfoView(): \Illuminate\Contracts\View\View
|
||||
private function renderEmulatorInfoView(): View
|
||||
{
|
||||
$status = $this->getEmulatorStatusText();
|
||||
|
||||
@@ -491,7 +491,7 @@ final class Commandocentrum extends Page implements HasForms
|
||||
]);
|
||||
}
|
||||
|
||||
private function renderEmulatorSettingsView(): \Illuminate\Contracts\View\View
|
||||
private function renderEmulatorSettingsView(): View
|
||||
{
|
||||
return view('filament.components.commandocentrum.emulator-settings', [
|
||||
'emulatorBranchesHtml' => $this->getEmulatorBranchesHtml(),
|
||||
@@ -499,7 +499,7 @@ final class Commandocentrum extends Page implements HasForms
|
||||
]);
|
||||
}
|
||||
|
||||
private function renderEmulatorStatusView(): \Illuminate\Contracts\View\View
|
||||
private function renderEmulatorStatusView(): View
|
||||
{
|
||||
$serviceName = $this->getSetting('emulator_service_name', 'arcturus');
|
||||
$jarPath = $this->getSetting('emulator_jar_path', '/var/www/Emulator');
|
||||
@@ -540,7 +540,7 @@ final class Commandocentrum extends Page implements HasForms
|
||||
]);
|
||||
}
|
||||
|
||||
private function renderNitroSettingsView(): \Illuminate\Contracts\View\View
|
||||
private function renderNitroSettingsView(): View
|
||||
{
|
||||
return view('filament.components.commandocentrum.nitro-settings', [
|
||||
'nitroBranchesHtml' => $this->getNitroBranchesHtml(),
|
||||
@@ -548,7 +548,7 @@ final class Commandocentrum extends Page implements HasForms
|
||||
]);
|
||||
}
|
||||
|
||||
private function renderNitroStatusView(): \Illuminate\Contracts\View\View
|
||||
private function renderNitroStatusView(): View
|
||||
{
|
||||
$clientPath = $this->getSetting('nitro_client_path', '/var/www/nitro-client');
|
||||
$rendererPath = $this->getSetting('nitro_renderer_path', '/var/www/nitro-renderer');
|
||||
@@ -572,7 +572,7 @@ final class Commandocentrum extends Page implements HasForms
|
||||
]);
|
||||
}
|
||||
|
||||
private function renderBackupsListView(): \Illuminate\Contracts\View\View
|
||||
private function renderBackupsListView(): View
|
||||
{
|
||||
try {
|
||||
$backups = app(EmulatorControlAction::class)->getBackups();
|
||||
@@ -585,7 +585,7 @@ final class Commandocentrum extends Page implements HasForms
|
||||
]);
|
||||
}
|
||||
|
||||
private function renderClothingStatusView(): \Illuminate\Contracts\View\View
|
||||
private function renderClothingStatusView(): View
|
||||
{
|
||||
try {
|
||||
$count = DB::table('catalog_clothing')->count();
|
||||
@@ -598,7 +598,7 @@ final class Commandocentrum extends Page implements HasForms
|
||||
]);
|
||||
}
|
||||
|
||||
private function renderStaffActivityView(): \Illuminate\Contracts\View\View
|
||||
private function renderStaffActivityView(): View
|
||||
{
|
||||
try {
|
||||
$activities = StaffActivity::with('user:id,username,look')
|
||||
@@ -614,7 +614,7 @@ final class Commandocentrum extends Page implements HasForms
|
||||
]);
|
||||
}
|
||||
|
||||
private function renderUpdateHistoryView(): \Illuminate\Contracts\View\View
|
||||
private function renderUpdateHistoryView(): View
|
||||
{
|
||||
try {
|
||||
$history = app(UpdateHistoryService::class)->getRecent(10);
|
||||
|
||||
@@ -18,6 +18,7 @@ use App\Models\Articles\WebsiteArticle;
|
||||
use App\Models\Miscellaneous\CameraWeb;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
@@ -70,12 +71,12 @@ class AuthController extends Controller
|
||||
], 201);
|
||||
}
|
||||
|
||||
public function user(\Illuminate\Http\Request $request): JsonResponse
|
||||
public function user(Request $request): JsonResponse
|
||||
{
|
||||
return response()->json(new UserApiResource($request->user()));
|
||||
}
|
||||
|
||||
public function logout(\Illuminate\Http\Request $request): JsonResponse
|
||||
public function logout(Request $request): JsonResponse
|
||||
{
|
||||
$request->user()->currentAccessToken()->delete();
|
||||
|
||||
|
||||
@@ -279,6 +279,7 @@ class FurniEditorController extends Controller
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function buildUpdateData(array $data): array
|
||||
@@ -323,6 +324,7 @@ class FurniEditorController extends Controller
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function buildInsertData(array $data): array
|
||||
|
||||
@@ -13,8 +13,6 @@ use App\Http\Resources\Api\HelpTicketResource;
|
||||
use App\Http\Resources\Api\LeaderboardUserResource;
|
||||
use App\Http\Resources\Api\PhotoResource;
|
||||
use App\Http\Resources\Api\ShopPackageResource;
|
||||
use App\Http\Resources\Api\UserApiResource;
|
||||
use App\Http\Resources\Api\UserBriefResource;
|
||||
use App\Models\Articles\WebsiteArticle;
|
||||
use App\Models\Game\Furniture\CatalogItem;
|
||||
use App\Models\Game\Furniture\CatalogPage;
|
||||
|
||||
@@ -7,6 +7,7 @@ use App\Models\Game\Player\UserCurrency;
|
||||
use App\Models\Game\Player\UserSetting;
|
||||
use App\Models\User;
|
||||
use App\Services\Community\StaffService;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\View\View;
|
||||
|
||||
@@ -60,7 +61,7 @@ class LeaderboardController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
private function retrieveSettings(string $column): \Illuminate\Database\Eloquent\Collection
|
||||
private function retrieveSettings(string $column): Collection
|
||||
{
|
||||
return UserSetting::query()
|
||||
->select(['user_id', $column])
|
||||
|
||||
@@ -302,6 +302,7 @@ class RadioController extends Controller
|
||||
|
||||
/**
|
||||
* @param array<RadioSettings> $keys
|
||||
*
|
||||
* @return array<string|null>
|
||||
*/
|
||||
private function getSettings(array $keys): array
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Shop;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\AccountTopupFormRequest;
|
||||
use App\Models\Shop\WebsitePaypalTransaction;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
@@ -23,6 +23,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
class WebsiteRareValue extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
class WebsiteRareValueCategory extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
class WebsiteStaffApplications extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $table = 'website_staff_applications';
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
class WebsiteTeam extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $table = 'website_teams';
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
class UserBadge extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $table = 'users_badges';
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
class UserCurrency extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $guarded = ['user_id', 'type'];
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class WebsiteHelpCenterCategory extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $guarded = ['id', 'created_at', 'updated_at', 'name', 'icon'];
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class WebsiteHelpCenterQuestion extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $table = 'help_questions';
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ use Stevebauman\Purify\Facades\Purify;
|
||||
class WebsiteHelpCenterTicketReply extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'ticket_id', 'content'];
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
class WebsiteRule extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $guarded = ['id', 'category_id', 'created_at', 'updated_at'];
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
class WebsiteRuleCategory extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
class WebsiteShopArticleFeature extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $guarded = ['id', 'created_at', 'updated_at', 'article_id', 'feature'];
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class WebsiteShopVoucher extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $guarded = ['id', 'created_at', 'updated_at', 'code', 'amount', 'max_uses', 'expires_at'];
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
class WebsiteUsedShopVoucher extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'voucher_id'];
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Referral extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'referrer_id'];
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
class WebsiteUserGuestbook extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
#[\Override]
|
||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'profile_id'];
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Services\Community;
|
||||
|
||||
use App\Models\RadioSchedule;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class RadioScheduleService
|
||||
@@ -53,7 +54,7 @@ class RadioScheduleService
|
||||
->get());
|
||||
}
|
||||
|
||||
public function getFullSchedule(): \Illuminate\Support\Collection
|
||||
public function getFullSchedule(): Collection
|
||||
{
|
||||
return Cache::remember('radio_schedule_all', 300, fn () => RadioSchedule::with('user:id,username,look')
|
||||
->active()
|
||||
|
||||
@@ -70,7 +70,7 @@ class DatabaseDiagnostic
|
||||
return DiagnosticResult::error(
|
||||
'Required Tables',
|
||||
'Missing: ' . implode(', ', $missing),
|
||||
'Run: php artisan migrate'
|
||||
'Run: php artisan migrate',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ class DatabaseDiagnostic
|
||||
return DiagnosticResult::warning(
|
||||
'Radio Tables',
|
||||
'Missing: ' . implode(', ', $missing),
|
||||
'Run radio migration seeder'
|
||||
'Run radio migration seeder',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@ class DiagnosticRunner
|
||||
$this->results = [];
|
||||
|
||||
$diagnostics = [
|
||||
new DatabaseDiagnostic(),
|
||||
new SecurityDiagnostic(),
|
||||
new SystemDiagnostic(),
|
||||
new HttpDiagnostic(),
|
||||
new DatabaseDiagnostic,
|
||||
new SecurityDiagnostic,
|
||||
new SystemDiagnostic,
|
||||
new HttpDiagnostic,
|
||||
];
|
||||
|
||||
foreach ($diagnostics as $diagnostic) {
|
||||
|
||||
@@ -26,7 +26,7 @@ class HttpDiagnostic
|
||||
return DiagnosticResult::warning(
|
||||
'App URL',
|
||||
'APP_URL not configured properly',
|
||||
'Set APP_URL in .env to your domain'
|
||||
'Set APP_URL in .env to your domain',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class HttpDiagnostic
|
||||
return DiagnosticResult::warning(
|
||||
'App URL',
|
||||
'Not using HTTPS in production',
|
||||
'Configure SSL and update APP_URL'
|
||||
'Configure SSL and update APP_URL',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ class HttpDiagnostic
|
||||
return DiagnosticResult::warning(
|
||||
'HTTP Redirect',
|
||||
"HTTP returns {$response->status()} instead of redirect",
|
||||
'Configure web server to redirect HTTP to HTTPS'
|
||||
'Configure web server to redirect HTTP to HTTPS',
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
return DiagnosticResult::warning('HTTP Redirect', 'Could not test: ' . $e->getMessage());
|
||||
|
||||
@@ -36,7 +36,7 @@ class SecurityDiagnostic
|
||||
return DiagnosticResult::error(
|
||||
'Debug Mode',
|
||||
'Debug mode is enabled in production',
|
||||
'Set APP_DEBUG=false in .env'
|
||||
'Set APP_DEBUG=false in .env',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ class SecurityDiagnostic
|
||||
return DiagnosticResult::warning(
|
||||
'.env File',
|
||||
'File appears to be on a single line',
|
||||
'Ensure .env has proper line breaks'
|
||||
'Ensure .env has proper line breaks',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ class SecurityDiagnostic
|
||||
return DiagnosticResult::error(
|
||||
'File Permissions',
|
||||
'Not writable: ' . implode(', ', $issues),
|
||||
'Run: chmod -R 775 storage bootstrap/cache'
|
||||
'Run: chmod -R 775 storage bootstrap/cache',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class SystemDiagnostic
|
||||
return DiagnosticResult::error(
|
||||
'PHP Extensions',
|
||||
'Missing: ' . implode(', ', $missing),
|
||||
'Install: sudo apt install php-' . implode(' php-', $missing)
|
||||
'Install: sudo apt install php-' . implode(' php-', $missing),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class SystemDiagnostic
|
||||
return DiagnosticResult::error(
|
||||
'PHP Version',
|
||||
'Current: ' . PHP_VERSION . ' (minimum: 8.1)',
|
||||
'Upgrade PHP to 8.1 or higher'
|
||||
'Upgrade PHP to 8.1 or higher',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ class SystemDiagnostic
|
||||
return DiagnosticResult::warning(
|
||||
'Session',
|
||||
'Using file sessions in production',
|
||||
'Consider using redis or database sessions'
|
||||
'Consider using redis or database sessions',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Services\Emulator;
|
||||
|
||||
use App\Services\Emulator\EmulatorSqlService;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Process;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Services\Emulator;
|
||||
|
||||
use App\Services\Emulator\EmulatorSourceService;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Process;
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Miscellaneous\WebsiteSetting;
|
||||
use App\Services\Emulator\EmulatorBackupService;
|
||||
use App\Services\Emulator\EmulatorBuildService;
|
||||
use App\Services\Emulator\EmulatorJarService;
|
||||
@@ -17,11 +18,17 @@ use Illuminate\Support\Facades\Process;
|
||||
class EmulatorUpdateService
|
||||
{
|
||||
private readonly EmulatorStatusService $statusService;
|
||||
|
||||
private readonly EmulatorJarService $jarService;
|
||||
|
||||
private readonly EmulatorSourceService $sourceService;
|
||||
|
||||
private readonly EmulatorBuildService $buildService;
|
||||
|
||||
private readonly EmulatorSqlService $sqlService;
|
||||
|
||||
private readonly EmulatorBackupService $backupService;
|
||||
|
||||
private readonly SettingsService $settings;
|
||||
|
||||
public function __construct()
|
||||
@@ -217,9 +224,9 @@ class EmulatorUpdateService
|
||||
|
||||
public function resetInstalledDate(): void
|
||||
{
|
||||
\App\Models\Miscellaneous\WebsiteSetting::where('key', 'emulator_jar_installed_date')->delete();
|
||||
\App\Models\Miscellaneous\WebsiteSetting::where('key', 'emulator_source_commit')->delete();
|
||||
\App\Models\Miscellaneous\WebsiteSetting::where('key', 'emulator_source_date')->delete();
|
||||
WebsiteSetting::where('key', 'emulator_jar_installed_date')->delete();
|
||||
WebsiteSetting::where('key', 'emulator_source_commit')->delete();
|
||||
WebsiteSetting::where('key', 'emulator_source_date')->delete();
|
||||
}
|
||||
|
||||
public function clearAllLogs(): array
|
||||
|
||||
Reference in New Issue
Block a user