diff --git a/app/Http/Controllers/Admin/NodesController.php b/app/Http/Controllers/Admin/NodesController.php index 76cabdfe..c0dd8a6e 100644 --- a/app/Http/Controllers/Admin/NodesController.php +++ b/app/Http/Controllers/Admin/NodesController.php @@ -30,9 +30,9 @@ use Pterodactyl\Models\Node; use Prologue\Alerts\AlertsMessageBag; use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Services\Nodes\NodeUpdateService; +use Illuminate\Cache\Repository as CacheRepository; use Pterodactyl\Services\Nodes\NodeCreationService; use Pterodactyl\Services\Nodes\NodeDeletionService; -use Illuminate\Cache\Repository as CacheRepository; use Pterodactyl\Services\Allocations\AssignmentService; use Pterodactyl\Http\Requests\Admin\Node\NodeFormRequest; use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; diff --git a/app/Http/Controllers/Admin/ServersController.php b/app/Http/Controllers/Admin/ServersController.php index 7557afb4..db84291b 100644 --- a/app/Http/Controllers/Admin/ServersController.php +++ b/app/Http/Controllers/Admin/ServersController.php @@ -30,11 +30,11 @@ use Pterodactyl\Models\Server; use Prologue\Alerts\AlertsMessageBag; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Http\Controllers\Controller; +use Pterodactyl\Services\Servers\SuspensionService; +use Pterodactyl\Http\Requests\Admin\ServerFormRequest; use Pterodactyl\Services\Servers\ServerCreationService; use Pterodactyl\Services\Servers\ServerDeletionService; use Pterodactyl\Services\Servers\ReinstallServerService; -use Pterodactyl\Services\Servers\SuspensionService; -use Pterodactyl\Http\Requests\Admin\ServerFormRequest; use Pterodactyl\Services\Servers\ContainerRebuildService; use Pterodactyl\Services\Servers\BuildModificationService; use Pterodactyl\Services\Database\DatabaseManagementService; diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 3aed7c02..6907eaaa 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -29,10 +29,10 @@ use Pterodactyl\Models\User; use Prologue\Alerts\AlertsMessageBag; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Http\Controllers\Controller; +use Illuminate\Contracts\Translation\Translator; use Pterodactyl\Services\Users\UserUpdateService; use Pterodactyl\Services\Users\UserCreationService; use Pterodactyl\Services\Users\UserDeletionService; -use Illuminate\Contracts\Translation\Translator; use Pterodactyl\Http\Requests\Admin\UserFormRequest; use Pterodactyl\Contracts\Repository\UserRepositoryInterface; diff --git a/app/Http/Controllers/Base/APIController.php b/app/Http/Controllers/Base/APIController.php index 72a4e7b6..4dedd30d 100644 --- a/app/Http/Controllers/Base/APIController.php +++ b/app/Http/Controllers/Base/APIController.php @@ -27,11 +27,11 @@ namespace Pterodactyl\Http\Controllers\Base; use Illuminate\Http\Request; use Prologue\Alerts\AlertsMessageBag; -use Pterodactyl\Http\Requests\Base\ApiKeyFormRequest; use Pterodactyl\Models\APIPermission; use Pterodactyl\Http\Controllers\Controller; -use Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface; use Pterodactyl\Services\Api\KeyCreationService; +use Pterodactyl\Http\Requests\Base\ApiKeyFormRequest; +use Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface; class APIController extends Controller { diff --git a/app/Http/Controllers/Base/AccountController.php b/app/Http/Controllers/Base/AccountController.php index 102850ed..fea7f09d 100644 --- a/app/Http/Controllers/Base/AccountController.php +++ b/app/Http/Controllers/Base/AccountController.php @@ -27,8 +27,8 @@ namespace Pterodactyl\Http\Controllers\Base; use Prologue\Alerts\AlertsMessageBag; use Pterodactyl\Http\Controllers\Controller; -use Pterodactyl\Http\Requests\Base\AccountDataFormRequest; use Pterodactyl\Services\Users\UserUpdateService; +use Pterodactyl\Http\Requests\Base\AccountDataFormRequest; class AccountController extends Controller { diff --git a/app/Http/Controllers/Base/IndexController.php b/app/Http/Controllers/Base/IndexController.php index 50416300..3c52a84f 100644 --- a/app/Http/Controllers/Base/IndexController.php +++ b/app/Http/Controllers/Base/IndexController.php @@ -26,9 +26,9 @@ namespace Pterodactyl\Http\Controllers\Base; use Illuminate\Http\Request; -use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Services\Servers\ServerAccessHelperService; +use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; class IndexController extends Controller diff --git a/app/Http/Controllers/Base/SecurityController.php b/app/Http/Controllers/Base/SecurityController.php index b44e6e0f..b44ecc12 100644 --- a/app/Http/Controllers/Base/SecurityController.php +++ b/app/Http/Controllers/Base/SecurityController.php @@ -25,15 +25,15 @@ namespace Pterodactyl\Http\Controllers\Base; -use Illuminate\Contracts\Config\Repository as ConfigRepository; -use Illuminate\Contracts\Session\Session; use Illuminate\Http\Request; use Prologue\Alerts\AlertsMessageBag; +use Illuminate\Contracts\Session\Session; +use Pterodactyl\Http\Controllers\Controller; +use Pterodactyl\Services\Users\TwoFactorSetupService; +use Pterodactyl\Services\Users\ToggleTwoFactorService; +use Illuminate\Contracts\Config\Repository as ConfigRepository; use Pterodactyl\Contracts\Repository\SessionRepositoryInterface; use Pterodactyl\Exceptions\Service\User\TwoFactorAuthenticationTokenInvalid; -use Pterodactyl\Http\Controllers\Controller; -use Pterodactyl\Services\Users\ToggleTwoFactorService; -use Pterodactyl\Services\Users\TwoFactorSetupService; class SecurityController extends Controller { diff --git a/app/Http/Requests/Base/AccountDataFormRequest.php b/app/Http/Requests/Base/AccountDataFormRequest.php index a9573106..63cacacf 100644 --- a/app/Http/Requests/Base/AccountDataFormRequest.php +++ b/app/Http/Requests/Base/AccountDataFormRequest.php @@ -24,9 +24,9 @@ namespace Pterodactyl\Http\Requests\Base; -use Pterodactyl\Exceptions\Http\Base\InvalidPasswordProvidedException; use Pterodactyl\Models\User; use Pterodactyl\Http\Requests\FrontendUserFormRequest; +use Pterodactyl\Exceptions\Http\Base\InvalidPasswordProvidedException; class AccountDataFormRequest extends FrontendUserFormRequest { diff --git a/app/Providers/RepositoryServiceProvider.php b/app/Providers/RepositoryServiceProvider.php index d30ae322..09c1c295 100644 --- a/app/Providers/RepositoryServiceProvider.php +++ b/app/Providers/RepositoryServiceProvider.php @@ -25,24 +25,21 @@ namespace Pterodactyl\Providers; use Illuminate\Support\ServiceProvider; -use Pterodactyl\Contracts\Repository\PermissionRepositoryInterface; -use Pterodactyl\Contracts\Repository\SessionRepositoryInterface; -use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; use Pterodactyl\Repositories\Daemon\FileRepository; use Pterodactyl\Repositories\Daemon\PowerRepository; use Pterodactyl\Repositories\Eloquent\NodeRepository; use Pterodactyl\Repositories\Eloquent\PackRepository; -use Pterodactyl\Repositories\Eloquent\PermissionRepository; -use Pterodactyl\Repositories\Eloquent\SessionRepository; -use Pterodactyl\Repositories\Eloquent\SubuserRepository; use Pterodactyl\Repositories\Eloquent\UserRepository; use Pterodactyl\Repositories\Daemon\CommandRepository; use Pterodactyl\Repositories\Eloquent\ApiKeyRepository; use Pterodactyl\Repositories\Eloquent\ServerRepository; use Pterodactyl\Repositories\Eloquent\ServiceRepository; +use Pterodactyl\Repositories\Eloquent\SessionRepository; +use Pterodactyl\Repositories\Eloquent\SubuserRepository; use Pterodactyl\Repositories\Eloquent\DatabaseRepository; use Pterodactyl\Repositories\Eloquent\LocationRepository; use Pterodactyl\Repositories\Eloquent\AllocationRepository; +use Pterodactyl\Repositories\Eloquent\PermissionRepository; use Pterodactyl\Repositories\Daemon\ConfigurationRepository; use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; use Pterodactyl\Contracts\Repository\PackRepositoryInterface; @@ -55,10 +52,13 @@ use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Repositories\Eloquent\OptionVariableRepository; use Pterodactyl\Repositories\Eloquent\ServerVariableRepository; use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface; +use Pterodactyl\Contracts\Repository\SessionRepositoryInterface; +use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; use Pterodactyl\Repositories\Eloquent\ServiceVariableRepository; use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface; use Pterodactyl\Contracts\Repository\LocationRepositoryInterface; use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface; +use Pterodactyl\Contracts\Repository\PermissionRepositoryInterface; use Pterodactyl\Contracts\Repository\Daemon\FileRepositoryInterface; use Pterodactyl\Contracts\Repository\Daemon\PowerRepositoryInterface; use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface; diff --git a/app/Repositories/Eloquent/ServerRepository.php b/app/Repositories/Eloquent/ServerRepository.php index ec89052b..227b7c22 100644 --- a/app/Repositories/Eloquent/ServerRepository.php +++ b/app/Repositories/Eloquent/ServerRepository.php @@ -24,11 +24,11 @@ namespace Pterodactyl\Repositories\Eloquent; +use Webmozart\Assert\Assert; use Pterodactyl\Models\Server; use Pterodactyl\Repositories\Concerns\Searchable; use Pterodactyl\Exceptions\Repository\RecordNotFoundException; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; -use Webmozart\Assert\Assert; class ServerRepository extends EloquentRepository implements ServerRepositoryInterface { diff --git a/app/Services/Servers/ServerAccessHelperService.php b/app/Services/Servers/ServerAccessHelperService.php index 4ee77012..2aef717f 100644 --- a/app/Services/Servers/ServerAccessHelperService.php +++ b/app/Services/Servers/ServerAccessHelperService.php @@ -24,11 +24,11 @@ namespace Pterodactyl\Services\Servers; +use Pterodactyl\Models\User; use Illuminate\Cache\Repository as CacheRepository; +use Pterodactyl\Contracts\Repository\UserRepositoryInterface; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; -use Pterodactyl\Contracts\Repository\UserRepositoryInterface; -use Pterodactyl\Models\User; class ServerAccessHelperService { diff --git a/app/Services/Users/ToggleTwoFactorService.php b/app/Services/Users/ToggleTwoFactorService.php index f731c13b..9de97c36 100644 --- a/app/Services/Users/ToggleTwoFactorService.php +++ b/app/Services/Users/ToggleTwoFactorService.php @@ -24,10 +24,10 @@ namespace Pterodactyl\Services\Users; +use Pterodactyl\Models\User; use PragmaRX\Google2FA\Contracts\Google2FA; use Pterodactyl\Contracts\Repository\UserRepositoryInterface; use Pterodactyl\Exceptions\Service\User\TwoFactorAuthenticationTokenInvalid; -use Pterodactyl\Models\User; class ToggleTwoFactorService { diff --git a/app/Services/Users/TwoFactorSetupService.php b/app/Services/Users/TwoFactorSetupService.php index d959ef6a..e9b26955 100644 --- a/app/Services/Users/TwoFactorSetupService.php +++ b/app/Services/Users/TwoFactorSetupService.php @@ -24,10 +24,10 @@ namespace Pterodactyl\Services\Users; -use Illuminate\Contracts\Config\Repository as ConfigRepository; +use Pterodactyl\Models\User; use PragmaRX\Google2FA\Contracts\Google2FA; use Pterodactyl\Contracts\Repository\UserRepositoryInterface; -use Pterodactyl\Models\User; +use Illuminate\Contracts\Config\Repository as ConfigRepository; class TwoFactorSetupService { diff --git a/tests/Unit/Http/Controllers/Base/AccountControllerTest.php b/tests/Unit/Http/Controllers/Base/AccountControllerTest.php index 1f9b556f..88d749c2 100644 --- a/tests/Unit/Http/Controllers/Base/AccountControllerTest.php +++ b/tests/Unit/Http/Controllers/Base/AccountControllerTest.php @@ -25,12 +25,12 @@ namespace Tests\Unit\Http\Controllers\Base; use Mockery as m; +use Tests\TestCase; use Prologue\Alerts\AlertsMessageBag; +use Tests\Assertions\ControllerAssertionsTrait; +use Pterodactyl\Services\Users\UserUpdateService; use Pterodactyl\Http\Controllers\Base\AccountController; use Pterodactyl\Http\Requests\Base\AccountDataFormRequest; -use Pterodactyl\Services\Users\UserUpdateService; -use Tests\Assertions\ControllerAssertionsTrait; -use Tests\TestCase; class AccountControllerTest extends TestCase { diff --git a/tests/Unit/Services/Api/KeyCreationServiceTest.php b/tests/Unit/Services/Api/KeyCreationServiceTest.php index fb9afd62..87d148c1 100644 --- a/tests/Unit/Services/Api/KeyCreationServiceTest.php +++ b/tests/Unit/Services/Api/KeyCreationServiceTest.php @@ -27,10 +27,10 @@ namespace Tests\Unit\Services\Api; use Mockery as m; use Tests\TestCase; use phpmock\phpunit\PHPMock; -use Pterodactyl\Services\Api\KeyCreationService; use Illuminate\Database\ConnectionInterface; use Illuminate\Contracts\Encryption\Encrypter; use Pterodactyl\Services\Api\PermissionService; +use Pterodactyl\Services\Api\KeyCreationService; use Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface; class KeyCreationServiceTest extends TestCase diff --git a/tests/Unit/Services/Nodes/NodeDeletionServiceTest.php b/tests/Unit/Services/Nodes/NodeDeletionServiceTest.php index 5a93d1d3..5f92d40f 100644 --- a/tests/Unit/Services/Nodes/NodeDeletionServiceTest.php +++ b/tests/Unit/Services/Nodes/NodeDeletionServiceTest.php @@ -27,8 +27,8 @@ namespace Tests\Unit\Services\Nodes; use Mockery as m; use Tests\TestCase; use Pterodactyl\Models\Node; -use Pterodactyl\Services\Nodes\NodeDeletionService; use Illuminate\Contracts\Translation\Translator; +use Pterodactyl\Services\Nodes\NodeDeletionService; use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; diff --git a/tests/Unit/Services/Users/ToggleTwoFactorServiceTest.php b/tests/Unit/Services/Users/ToggleTwoFactorServiceTest.php index 8714f974..28a98ccf 100644 --- a/tests/Unit/Services/Users/ToggleTwoFactorServiceTest.php +++ b/tests/Unit/Services/Users/ToggleTwoFactorServiceTest.php @@ -25,11 +25,11 @@ namespace Tests\Unit\Services\Users; use Mockery as m; -use PragmaRX\Google2FA\Contracts\Google2FA; -use Pterodactyl\Contracts\Repository\UserRepositoryInterface; -use Pterodactyl\Models\User; -use Pterodactyl\Services\Users\ToggleTwoFactorService; use Tests\TestCase; +use Pterodactyl\Models\User; +use PragmaRX\Google2FA\Contracts\Google2FA; +use Pterodactyl\Services\Users\ToggleTwoFactorService; +use Pterodactyl\Contracts\Repository\UserRepositoryInterface; class ToggleTwoFactorServiceTest extends TestCase { diff --git a/tests/Unit/Services/Users/TwoFactorSetupServiceTest.php b/tests/Unit/Services/Users/TwoFactorSetupServiceTest.php index 5d5b3ad9..d9dbc68f 100644 --- a/tests/Unit/Services/Users/TwoFactorSetupServiceTest.php +++ b/tests/Unit/Services/Users/TwoFactorSetupServiceTest.php @@ -24,13 +24,13 @@ namespace Tests\Unit\Services\Users; -use Illuminate\Contracts\Config\Repository; use Mockery as m; -use PragmaRX\Google2FA\Contracts\Google2FA; -use Pterodactyl\Contracts\Repository\UserRepositoryInterface; -use Pterodactyl\Models\User; -use Pterodactyl\Services\Users\TwoFactorSetupService; use Tests\TestCase; +use Pterodactyl\Models\User; +use Illuminate\Contracts\Config\Repository; +use PragmaRX\Google2FA\Contracts\Google2FA; +use Pterodactyl\Services\Users\TwoFactorSetupService; +use Pterodactyl\Contracts\Repository\UserRepositoryInterface; class TwoFactorSetupServiceTest extends TestCase { diff --git a/tests/Unit/Services/Users/UserDeletionServiceTest.php b/tests/Unit/Services/Users/UserDeletionServiceTest.php index cd955f34..a156573a 100644 --- a/tests/Unit/Services/Users/UserDeletionServiceTest.php +++ b/tests/Unit/Services/Users/UserDeletionServiceTest.php @@ -27,8 +27,8 @@ namespace Tests\Unit\Services\Users; use Mockery as m; use Tests\TestCase; use Pterodactyl\Models\User; -use Pterodactyl\Services\Users\UserDeletionService; use Illuminate\Contracts\Translation\Translator; +use Pterodactyl\Services\Users\UserDeletionService; use Pterodactyl\Contracts\Repository\UserRepositoryInterface; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;