diff --git a/.php_cs b/.php_cs index fe3dfb56a..b6a20178c 100644 --- a/.php_cs +++ b/.php_cs @@ -35,6 +35,9 @@ return PhpCsFixer\Config::create() 'no_unreachable_default_argument_value' => true, 'no_useless_return' => true, 'not_operator_with_successor_space' => true, + 'ordered_imports' => [ + 'sortAlgorithm' => 'length', + ], 'phpdoc_align' => ['tags' => ['param']], 'phpdoc_separation' => false, 'protected_to_private' => false, diff --git a/app/Http/Controllers/Server/SubuserController.php b/app/Http/Controllers/Server/SubuserController.php index 031c8cece..3d287fd9e 100644 --- a/app/Http/Controllers/Server/SubuserController.php +++ b/app/Http/Controllers/Server/SubuserController.php @@ -24,16 +24,16 @@ namespace Pterodactyl\Http\Controllers\Server; -use Illuminate\Contracts\Session\Session; -use Prologue\Alerts\AlertsMessageBag; -use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; use Illuminate\Http\Request; -use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Models\Permission; -use Pterodactyl\Services\Subusers\SubuserCreationService; -use Pterodactyl\Services\Subusers\SubuserDeletionService; +use Prologue\Alerts\AlertsMessageBag; +use Illuminate\Contracts\Session\Session; +use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Services\Subusers\SubuserUpdateService; use Pterodactyl\Traits\Controllers\JavascriptInjection; +use Pterodactyl\Services\Subusers\SubuserCreationService; +use Pterodactyl\Services\Subusers\SubuserDeletionService; +use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; class SubuserController extends Controller { diff --git a/app/Http/Middleware/Server/SubuserAccess.php b/app/Http/Middleware/Server/SubuserAccess.php index c14d2ea98..97e08af5a 100644 --- a/app/Http/Middleware/Server/SubuserAccess.php +++ b/app/Http/Middleware/Server/SubuserAccess.php @@ -26,8 +26,8 @@ namespace Pterodactyl\Http\Middleware\Server; use Closure; use Illuminate\Contracts\Session\Session; -use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; use Pterodactyl\Exceptions\DisplayException; +use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; class SubuserAccess diff --git a/app/Services/Subusers/SubuserCreationService.php b/app/Services/Subusers/SubuserCreationService.php index c095cce90..4a13adfde 100644 --- a/app/Services/Subusers/SubuserCreationService.php +++ b/app/Services/Subusers/SubuserCreationService.php @@ -25,13 +25,13 @@ namespace Pterodactyl\Services\Subusers; use Illuminate\Log\Writer; -use Pterodactyl\Exceptions\Repository\RecordNotFoundException; use Pterodactyl\Models\Server; use GuzzleHttp\Exception\RequestException; use Illuminate\Database\ConnectionInterface; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Services\Users\UserCreationService; use Pterodactyl\Contracts\Repository\UserRepositoryInterface; +use Pterodactyl\Exceptions\Repository\RecordNotFoundException; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; use Pterodactyl\Exceptions\Service\Subuser\UserIsServerOwnerException; diff --git a/tests/Unit/Http/Controllers/Server/Files/RemoteRequestControllerTest.php b/tests/Unit/Http/Controllers/Server/Files/RemoteRequestControllerTest.php index 29eecb315..1235635e6 100644 --- a/tests/Unit/Http/Controllers/Server/Files/RemoteRequestControllerTest.php +++ b/tests/Unit/Http/Controllers/Server/Files/RemoteRequestControllerTest.php @@ -24,17 +24,17 @@ namespace Tests\Unit\Http\Controllers\Server\Files; +use Mockery as m; +use Tests\TestCase; +use Illuminate\Log\Writer; +use Illuminate\Http\Request; +use Pterodactyl\Models\Server; +use Illuminate\Contracts\Session\Session; use GuzzleHttp\Exception\RequestException; use Illuminate\Contracts\Config\Repository; -use Illuminate\Contracts\Session\Session; -use Illuminate\Http\Request; -use Illuminate\Log\Writer; -use Mockery as m; +use Tests\Assertions\ControllerAssertionsTrait; use Pterodactyl\Contracts\Repository\Daemon\FileRepositoryInterface; use Pterodactyl\Http\Controllers\Server\Files\RemoteRequestController; -use Pterodactyl\Models\Server; -use Tests\Assertions\ControllerAssertionsTrait; -use Tests\TestCase; class RemoteRequestControllerTest extends TestCase { diff --git a/tests/Unit/Http/Controllers/Server/SubuserControllerTest.php b/tests/Unit/Http/Controllers/Server/SubuserControllerTest.php index adfbdf346..312cce060 100644 --- a/tests/Unit/Http/Controllers/Server/SubuserControllerTest.php +++ b/tests/Unit/Http/Controllers/Server/SubuserControllerTest.php @@ -24,20 +24,20 @@ namespace Tests\Unit\Http\Controllers\Server; -use Illuminate\Contracts\Session\Session; -use Illuminate\Http\Request; use Mockery as m; -use Prologue\Alerts\AlertsMessageBag; -use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; -use Pterodactyl\Http\Controllers\Server\SubuserController; -use Pterodactyl\Models\Permission; +use Tests\TestCase; +use Illuminate\Http\Request; use Pterodactyl\Models\Server; use Pterodactyl\Models\Subuser; +use Pterodactyl\Models\Permission; +use Prologue\Alerts\AlertsMessageBag; +use Illuminate\Contracts\Session\Session; +use Tests\Assertions\ControllerAssertionsTrait; +use Pterodactyl\Services\Subusers\SubuserUpdateService; use Pterodactyl\Services\Subusers\SubuserCreationService; use Pterodactyl\Services\Subusers\SubuserDeletionService; -use Pterodactyl\Services\Subusers\SubuserUpdateService; -use Tests\Assertions\ControllerAssertionsTrait; -use Tests\TestCase; +use Pterodactyl\Http\Controllers\Server\SubuserController; +use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; class SubuserControllerTest extends TestCase { diff --git a/tests/Unit/Services/Subusers/SubuserCreationServiceTest.php b/tests/Unit/Services/Subusers/SubuserCreationServiceTest.php index 7dcd67927..d188e22a3 100644 --- a/tests/Unit/Services/Subusers/SubuserCreationServiceTest.php +++ b/tests/Unit/Services/Subusers/SubuserCreationServiceTest.php @@ -25,7 +25,6 @@ namespace Tests\Unit\Services\Subusers; use Mockery as m; -use Pterodactyl\Exceptions\Repository\RecordNotFoundException; use Tests\TestCase; use Illuminate\Log\Writer; use phpmock\phpunit\PHPMock; @@ -38,6 +37,7 @@ use Pterodactyl\Services\Users\UserCreationService; use Pterodactyl\Services\Subusers\SubuserCreationService; use Pterodactyl\Services\Subusers\PermissionCreationService; use Pterodactyl\Contracts\Repository\UserRepositoryInterface; +use Pterodactyl\Exceptions\Repository\RecordNotFoundException; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; use Pterodactyl\Exceptions\Service\Subuser\UserIsServerOwnerException;