From 1e1eac1b9c717db991d2be610620e5a6a46d1051 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 27 Aug 2017 14:55:25 -0500 Subject: [PATCH] Apply fixes from StyleCI (#607) --- app/Http/Controllers/Admin/PackController.php | 20 +++++++------- app/Models/Permission.php | 2 +- app/Models/Subuser.php | 4 +-- app/Providers/RepositoryServiceProvider.php | 10 +++---- app/Repositories/Daemon/BaseRepository.php | 2 +- app/Repositories/Daemon/FileRepository.php | 2 +- app/Repositories/Daemon/ServerRepository.php | 2 +- .../Eloquent/DatabaseRepository.php | 2 +- .../Eloquent/LocationRepository.php | 2 +- app/Repositories/Eloquent/NodeRepository.php | 2 +- app/Repositories/Eloquent/PackRepository.php | 8 +++--- .../Eloquent/SubuserRepository.php | 6 ++--- app/Services/Database/DatabaseHostService.php | 4 +-- app/Services/Nodes/DeletionService.php | 2 +- app/Services/Packs/ExportPackService.php | 8 +++--- app/Services/Packs/PackCreationService.php | 2 +- .../Subusers/SubuserCreationService.php | 14 +++++----- .../Subusers/SubuserUpdateService.php | 8 +++--- .../Eloquent/AllocationRepositoryTest.php | 6 ++--- .../Eloquent/ApiKeyRepositoryTest.php | 6 ++--- .../Eloquent/ApiPermissionRepositoryTest.php | 6 ++--- .../Eloquent/DatabaseHostRepositoryTest.php | 6 ++--- .../Eloquent/DatabaseRepositoryTest.php | 10 +++---- .../Eloquent/LocationRepositoryTest.php | 6 ++--- .../Database/DatabaseHostServiceTest.php | 4 +-- .../Helpers/SoftwareVersionServiceTest.php | 6 ++--- .../Services/Packs/ExportPackServiceTest.php | 14 +++++----- .../Packs/PackCreationServiceTest.php | 16 +++++------ .../Packs/PackDeletionServiceTest.php | 12 ++++----- .../Services/Packs/PackUpdateServiceTest.php | 8 +++--- .../Packs/TemplateUploadServiceTest.php | 16 +++++------ .../PermissionCreationServiceTest.php | 4 +-- .../Subusers/SubuserCreationServiceTest.php | 27 +++++++++---------- .../Subusers/SubuserDeletionServiceTest.php | 13 +++++---- .../Subusers/SubuserUpdateServiceTest.php | 16 +++++------ 35 files changed, 137 insertions(+), 139 deletions(-) diff --git a/app/Http/Controllers/Admin/PackController.php b/app/Http/Controllers/Admin/PackController.php index 604ba3337..ae06aff0b 100644 --- a/app/Http/Controllers/Admin/PackController.php +++ b/app/Http/Controllers/Admin/PackController.php @@ -24,19 +24,19 @@ namespace Pterodactyl\Http\Controllers\Admin; -use Illuminate\Contracts\Config\Repository as ConfigRepository; -use Prologue\Alerts\AlertsMessageBag; -use Pterodactyl\Contracts\Repository\PackRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface; -use Pterodactyl\Http\Requests\Admin\PackFormRequest; -use Pterodactyl\Services\Packs\ExportPackService; -use Pterodactyl\Services\Packs\PackCreationService; -use Pterodactyl\Services\Packs\PackDeletionService; -use Pterodactyl\Services\Packs\PackUpdateService; -use Pterodactyl\Services\Packs\TemplateUploadService; use Illuminate\Http\Request; use Pterodactyl\Models\Pack; +use Prologue\Alerts\AlertsMessageBag; use Pterodactyl\Http\Controllers\Controller; +use Pterodactyl\Services\Packs\ExportPackService; +use Pterodactyl\Services\Packs\PackUpdateService; +use Pterodactyl\Services\Packs\PackCreationService; +use Pterodactyl\Services\Packs\PackDeletionService; +use Pterodactyl\Http\Requests\Admin\PackFormRequest; +use Pterodactyl\Services\Packs\TemplateUploadService; +use Pterodactyl\Contracts\Repository\PackRepositoryInterface; +use Illuminate\Contracts\Config\Repository as ConfigRepository; +use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface; class PackController extends Controller { diff --git a/app/Models/Permission.php b/app/Models/Permission.php index 3587e7fc3..7d4619c64 100644 --- a/app/Models/Permission.php +++ b/app/Models/Permission.php @@ -24,9 +24,9 @@ namespace Pterodactyl\Models; +use Sofa\Eloquence\Eloquence; use Illuminate\Database\Eloquent\Model; use Sofa\Eloquence\Contracts\CleansAttributes; -use Sofa\Eloquence\Eloquence; class Permission extends Model implements CleansAttributes { diff --git a/app/Models/Subuser.php b/app/Models/Subuser.php index 276f97b98..5326da3f4 100644 --- a/app/Models/Subuser.php +++ b/app/Models/Subuser.php @@ -24,12 +24,12 @@ namespace Pterodactyl\Models; +use Sofa\Eloquence\Eloquence; +use Sofa\Eloquence\Validable; use Illuminate\Database\Eloquent\Model; use Illuminate\Notifications\Notifiable; use Sofa\Eloquence\Contracts\CleansAttributes; use Sofa\Eloquence\Contracts\Validable as ValidableContract; -use Sofa\Eloquence\Eloquence; -use Sofa\Eloquence\Validable; class Subuser extends Model implements CleansAttributes, ValidableContract { diff --git a/app/Providers/RepositoryServiceProvider.php b/app/Providers/RepositoryServiceProvider.php index 178c91025..a0a85fae1 100644 --- a/app/Providers/RepositoryServiceProvider.php +++ b/app/Providers/RepositoryServiceProvider.php @@ -25,16 +25,12 @@ namespace Pterodactyl\Providers; use Illuminate\Support\ServiceProvider; -use Pterodactyl\Contracts\Repository\Daemon\CommandRepositoryInterface; -use Pterodactyl\Contracts\Repository\Daemon\FileRepositoryInterface; -use Pterodactyl\Contracts\Repository\Daemon\PowerRepositoryInterface; -use Pterodactyl\Contracts\Repository\PackRepositoryInterface; -use Pterodactyl\Repositories\Daemon\CommandRepository; use Pterodactyl\Repositories\Daemon\FileRepository; use Pterodactyl\Repositories\Daemon\PowerRepository; use Pterodactyl\Repositories\Eloquent\NodeRepository; use Pterodactyl\Repositories\Eloquent\PackRepository; 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; @@ -43,6 +39,7 @@ use Pterodactyl\Repositories\Eloquent\LocationRepository; use Pterodactyl\Repositories\Eloquent\AllocationRepository; use Pterodactyl\Repositories\Daemon\ConfigurationRepository; use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; +use Pterodactyl\Contracts\Repository\PackRepositoryInterface; use Pterodactyl\Contracts\Repository\UserRepositoryInterface; use Pterodactyl\Repositories\Eloquent\DatabaseHostRepository; use Pterodactyl\Repositories\Eloquent\ApiPermissionRepository; @@ -56,9 +53,12 @@ use Pterodactyl\Repositories\Eloquent\ServiceVariableRepository; use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface; use Pterodactyl\Contracts\Repository\LocationRepositoryInterface; use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface; +use Pterodactyl\Contracts\Repository\Daemon\FileRepositoryInterface; +use Pterodactyl\Contracts\Repository\Daemon\PowerRepositoryInterface; use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface; use Pterodactyl\Contracts\Repository\ApiPermissionRepositoryInterface; use Pterodactyl\Contracts\Repository\ServiceOptionRepositoryInterface; +use Pterodactyl\Contracts\Repository\Daemon\CommandRepositoryInterface; use Pterodactyl\Contracts\Repository\OptionVariableRepositoryInterface; use Pterodactyl\Contracts\Repository\ServerVariableRepositoryInterface; use Pterodactyl\Contracts\Repository\ServiceVariableRepositoryInterface; diff --git a/app/Repositories/Daemon/BaseRepository.php b/app/Repositories/Daemon/BaseRepository.php index fc62d73e9..26fb898c9 100644 --- a/app/Repositories/Daemon/BaseRepository.php +++ b/app/Repositories/Daemon/BaseRepository.php @@ -25,11 +25,11 @@ namespace Pterodactyl\Repositories\Daemon; use GuzzleHttp\Client; +use Webmozart\Assert\Assert; use Illuminate\Foundation\Application; use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; use Illuminate\Contracts\Config\Repository as ConfigRepository; use Pterodactyl\Contracts\Repository\Daemon\BaseRepositoryInterface; -use Webmozart\Assert\Assert; class BaseRepository implements BaseRepositoryInterface { diff --git a/app/Repositories/Daemon/FileRepository.php b/app/Repositories/Daemon/FileRepository.php index 71182b11c..30e73c821 100644 --- a/app/Repositories/Daemon/FileRepository.php +++ b/app/Repositories/Daemon/FileRepository.php @@ -24,8 +24,8 @@ namespace Pterodactyl\Repositories\Daemon; -use Pterodactyl\Contracts\Repository\Daemon\FileRepositoryInterface; use Webmozart\Assert\Assert; +use Pterodactyl\Contracts\Repository\Daemon\FileRepositoryInterface; class FileRepository extends BaseRepository implements FileRepositoryInterface { diff --git a/app/Repositories/Daemon/ServerRepository.php b/app/Repositories/Daemon/ServerRepository.php index a761510da..594bb1752 100644 --- a/app/Repositories/Daemon/ServerRepository.php +++ b/app/Repositories/Daemon/ServerRepository.php @@ -24,10 +24,10 @@ namespace Pterodactyl\Repositories\Daemon; +use Webmozart\Assert\Assert; use Pterodactyl\Services\Servers\EnvironmentService; use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface as DatabaseServerRepositoryInterface; -use Webmozart\Assert\Assert; class ServerRepository extends BaseRepository implements ServerRepositoryInterface { diff --git a/app/Repositories/Eloquent/DatabaseRepository.php b/app/Repositories/Eloquent/DatabaseRepository.php index 120006806..995b7db20 100644 --- a/app/Repositories/Eloquent/DatabaseRepository.php +++ b/app/Repositories/Eloquent/DatabaseRepository.php @@ -24,11 +24,11 @@ namespace Pterodactyl\Repositories\Eloquent; -use Pterodactyl\Exceptions\Repository\DuplicateDatabaseNameException; use Pterodactyl\Models\Database; use Illuminate\Foundation\Application; use Illuminate\Database\DatabaseManager; use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface; +use Pterodactyl\Exceptions\Repository\DuplicateDatabaseNameException; class DatabaseRepository extends EloquentRepository implements DatabaseRepositoryInterface { diff --git a/app/Repositories/Eloquent/LocationRepository.php b/app/Repositories/Eloquent/LocationRepository.php index 229e1e112..318493a8b 100644 --- a/app/Repositories/Eloquent/LocationRepository.php +++ b/app/Repositories/Eloquent/LocationRepository.php @@ -26,9 +26,9 @@ namespace Pterodactyl\Repositories\Eloquent; use Pterodactyl\Models\Location; use Pterodactyl\Exceptions\DisplayException; +use Pterodactyl\Repositories\Concerns\Searchable; use Pterodactyl\Exceptions\Repository\RecordNotFoundException; use Pterodactyl\Contracts\Repository\LocationRepositoryInterface; -use Pterodactyl\Repositories\Concerns\Searchable; class LocationRepository extends EloquentRepository implements LocationRepositoryInterface { diff --git a/app/Repositories/Eloquent/NodeRepository.php b/app/Repositories/Eloquent/NodeRepository.php index e421d778e..240f97918 100644 --- a/app/Repositories/Eloquent/NodeRepository.php +++ b/app/Repositories/Eloquent/NodeRepository.php @@ -25,9 +25,9 @@ namespace Pterodactyl\Repositories\Eloquent; use Pterodactyl\Models\Node; +use Pterodactyl\Repositories\Concerns\Searchable; use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; use Pterodactyl\Exceptions\Repository\RecordNotFoundException; -use Pterodactyl\Repositories\Concerns\Searchable; class NodeRepository extends EloquentRepository implements NodeRepositoryInterface { diff --git a/app/Repositories/Eloquent/PackRepository.php b/app/Repositories/Eloquent/PackRepository.php index 5f1641f78..56b04d2eb 100644 --- a/app/Repositories/Eloquent/PackRepository.php +++ b/app/Repositories/Eloquent/PackRepository.php @@ -24,12 +24,12 @@ namespace Pterodactyl\Repositories\Eloquent; -use Illuminate\Database\Eloquent\ModelNotFoundException; use Pterodactyl\Models\Pack; -use Illuminate\Contracts\Filesystem\Factory as FilesystemFactory; -use Pterodactyl\Repositories\Concerns\Searchable; -use Pterodactyl\Contracts\Repository\PackRepositoryInterface; use Webmozart\Assert\Assert; +use Pterodactyl\Repositories\Concerns\Searchable; +use Illuminate\Database\Eloquent\ModelNotFoundException; +use Pterodactyl\Contracts\Repository\PackRepositoryInterface; +use Illuminate\Contracts\Filesystem\Factory as FilesystemFactory; class PackRepository extends EloquentRepository implements PackRepositoryInterface { diff --git a/app/Repositories/Eloquent/SubuserRepository.php b/app/Repositories/Eloquent/SubuserRepository.php index 92f4b1867..7b7eaa8a8 100644 --- a/app/Repositories/Eloquent/SubuserRepository.php +++ b/app/Repositories/Eloquent/SubuserRepository.php @@ -24,10 +24,10 @@ namespace Pterodactyl\Repositories\Eloquent; -use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; -use Pterodactyl\Exceptions\Repository\RecordNotFoundException; -use Pterodactyl\Models\Subuser; use Webmozart\Assert\Assert; +use Pterodactyl\Models\Subuser; +use Pterodactyl\Exceptions\Repository\RecordNotFoundException; +use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; class SubuserRepository extends EloquentRepository implements SubuserRepositoryInterface { diff --git a/app/Services/Database/DatabaseHostService.php b/app/Services/Database/DatabaseHostService.php index 2ad11eccf..f64f3a941 100644 --- a/app/Services/Database/DatabaseHostService.php +++ b/app/Services/Database/DatabaseHostService.php @@ -25,10 +25,10 @@ namespace Pterodactyl\Services\Database; use Illuminate\Database\DatabaseManager; -use Illuminate\Contracts\Encryption\Encrypter; -use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface; use Pterodactyl\Exceptions\DisplayException; +use Illuminate\Contracts\Encryption\Encrypter; use Pterodactyl\Extensions\DynamicDatabaseConnection; +use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface; use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface; class DatabaseHostService diff --git a/app/Services/Nodes/DeletionService.php b/app/Services/Nodes/DeletionService.php index 6cbab2644..f5180ce03 100644 --- a/app/Services/Nodes/DeletionService.php +++ b/app/Services/Nodes/DeletionService.php @@ -24,10 +24,10 @@ namespace Pterodactyl\Services\Nodes; -use Pterodactyl\Exceptions\Service\HasActiveServersException; use Pterodactyl\Models\Node; use Illuminate\Contracts\Translation\Translator; use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; +use Pterodactyl\Exceptions\Service\HasActiveServersException; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; class DeletionService diff --git a/app/Services/Packs/ExportPackService.php b/app/Services/Packs/ExportPackService.php index 42f1cf305..1f5ac7b42 100644 --- a/app/Services/Packs/ExportPackService.php +++ b/app/Services/Packs/ExportPackService.php @@ -24,11 +24,11 @@ namespace Pterodactyl\Services\Packs; -use Illuminate\Contracts\Filesystem\Factory as FilesystemFactory; -use Pterodactyl\Contracts\Repository\PackRepositoryInterface; -use Pterodactyl\Exceptions\Service\Pack\ZipArchiveCreationException; -use Pterodactyl\Models\Pack; use ZipArchive; +use Pterodactyl\Models\Pack; +use Pterodactyl\Contracts\Repository\PackRepositoryInterface; +use Illuminate\Contracts\Filesystem\Factory as FilesystemFactory; +use Pterodactyl\Exceptions\Service\Pack\ZipArchiveCreationException; class ExportPackService { diff --git a/app/Services/Packs/PackCreationService.php b/app/Services/Packs/PackCreationService.php index 9890882ff..b42740237 100644 --- a/app/Services/Packs/PackCreationService.php +++ b/app/Services/Packs/PackCreationService.php @@ -24,8 +24,8 @@ namespace Pterodactyl\Services\Packs; -use Illuminate\Http\UploadedFile; use Ramsey\Uuid\Uuid; +use Illuminate\Http\UploadedFile; use Illuminate\Database\ConnectionInterface; use Pterodactyl\Contracts\Repository\PackRepositoryInterface; use Illuminate\Contracts\Filesystem\Factory as FilesystemFactory; diff --git a/app/Services/Subusers/SubuserCreationService.php b/app/Services/Subusers/SubuserCreationService.php index 3de92e27c..cdcd4c3a5 100644 --- a/app/Services/Subusers/SubuserCreationService.php +++ b/app/Services/Subusers/SubuserCreationService.php @@ -24,18 +24,18 @@ namespace Pterodactyl\Services\Subusers; +use Illuminate\Log\Writer; +use Pterodactyl\Models\Server; use GuzzleHttp\Exception\RequestException; use Illuminate\Database\ConnectionInterface; -use Illuminate\Log\Writer; -use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; +use Pterodactyl\Exceptions\DisplayException; +use Pterodactyl\Services\Users\CreationService; +use Pterodactyl\Contracts\Repository\UserRepositoryInterface; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; -use Pterodactyl\Contracts\Repository\UserRepositoryInterface; -use Pterodactyl\Exceptions\DisplayException; -use Pterodactyl\Exceptions\Service\Subuser\ServerSubuserExistsException; use Pterodactyl\Exceptions\Service\Subuser\UserIsServerOwnerException; -use Pterodactyl\Models\Server; -use Pterodactyl\Services\Users\CreationService; +use Pterodactyl\Exceptions\Service\Subuser\ServerSubuserExistsException; +use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; class SubuserCreationService { diff --git a/app/Services/Subusers/SubuserUpdateService.php b/app/Services/Subusers/SubuserUpdateService.php index f69870cd7..11faf5bb5 100644 --- a/app/Services/Subusers/SubuserUpdateService.php +++ b/app/Services/Subusers/SubuserUpdateService.php @@ -24,13 +24,13 @@ namespace Pterodactyl\Services\Subusers; +use Illuminate\Log\Writer; use GuzzleHttp\Exception\RequestException; use Illuminate\Database\ConnectionInterface; -use Illuminate\Log\Writer; -use Pterodactyl\Contracts\Repository\PermissionRepositoryInterface; -use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; -use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; use Pterodactyl\Exceptions\DisplayException; +use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; +use Pterodactyl\Contracts\Repository\PermissionRepositoryInterface; +use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; class SubuserUpdateService { diff --git a/tests/Unit/Repositories/Eloquent/AllocationRepositoryTest.php b/tests/Unit/Repositories/Eloquent/AllocationRepositoryTest.php index 0c7b6f4cf..9d889118b 100644 --- a/tests/Unit/Repositories/Eloquent/AllocationRepositoryTest.php +++ b/tests/Unit/Repositories/Eloquent/AllocationRepositoryTest.php @@ -24,11 +24,11 @@ namespace Tests\Unit\Repositories\Eloquent; -use Illuminate\Database\Eloquent\Builder; use Mockery as m; -use Pterodactyl\Models\Allocation; -use Pterodactyl\Repositories\Eloquent\AllocationRepository; use Tests\TestCase; +use Pterodactyl\Models\Allocation; +use Illuminate\Database\Eloquent\Builder; +use Pterodactyl\Repositories\Eloquent\AllocationRepository; class AllocationRepositoryTest extends TestCase { diff --git a/tests/Unit/Repositories/Eloquent/ApiKeyRepositoryTest.php b/tests/Unit/Repositories/Eloquent/ApiKeyRepositoryTest.php index eadfbde48..8d8574b0c 100644 --- a/tests/Unit/Repositories/Eloquent/ApiKeyRepositoryTest.php +++ b/tests/Unit/Repositories/Eloquent/ApiKeyRepositoryTest.php @@ -24,11 +24,11 @@ namespace Tests\Unit\Repositories\Eloquent; -use Illuminate\Database\Eloquent\Builder; use Mockery as m; -use Pterodactyl\Models\APIKey; -use Pterodactyl\Repositories\Eloquent\ApiKeyRepository; use Tests\TestCase; +use Pterodactyl\Models\APIKey; +use Illuminate\Database\Eloquent\Builder; +use Pterodactyl\Repositories\Eloquent\ApiKeyRepository; class ApiKeyRepositoryTest extends TestCase { diff --git a/tests/Unit/Repositories/Eloquent/ApiPermissionRepositoryTest.php b/tests/Unit/Repositories/Eloquent/ApiPermissionRepositoryTest.php index 945693c5c..8d601f806 100644 --- a/tests/Unit/Repositories/Eloquent/ApiPermissionRepositoryTest.php +++ b/tests/Unit/Repositories/Eloquent/ApiPermissionRepositoryTest.php @@ -24,11 +24,11 @@ namespace Tests\Unit\Repositories\Eloquent; -use Illuminate\Database\Eloquent\Builder; use Mockery as m; -use Pterodactyl\Models\APIPermission; -use Pterodactyl\Repositories\Eloquent\ApiPermissionRepository; use Tests\TestCase; +use Pterodactyl\Models\APIPermission; +use Illuminate\Database\Eloquent\Builder; +use Pterodactyl\Repositories\Eloquent\ApiPermissionRepository; class ApiPermissionRepositoryTest extends TestCase { diff --git a/tests/Unit/Repositories/Eloquent/DatabaseHostRepositoryTest.php b/tests/Unit/Repositories/Eloquent/DatabaseHostRepositoryTest.php index 389961b68..d74d8e060 100644 --- a/tests/Unit/Repositories/Eloquent/DatabaseHostRepositoryTest.php +++ b/tests/Unit/Repositories/Eloquent/DatabaseHostRepositoryTest.php @@ -24,11 +24,11 @@ namespace Tests\Unit\Repositories\Eloquent; -use Illuminate\Database\Eloquent\Builder; use Mockery as m; -use Pterodactyl\Models\DatabaseHost; -use Pterodactyl\Repositories\Eloquent\DatabaseHostRepository; use Tests\TestCase; +use Pterodactyl\Models\DatabaseHost; +use Illuminate\Database\Eloquent\Builder; +use Pterodactyl\Repositories\Eloquent\DatabaseHostRepository; class DatabaseHostRepositoryTest extends TestCase { diff --git a/tests/Unit/Repositories/Eloquent/DatabaseRepositoryTest.php b/tests/Unit/Repositories/Eloquent/DatabaseRepositoryTest.php index e18802c33..aaceac3fa 100644 --- a/tests/Unit/Repositories/Eloquent/DatabaseRepositoryTest.php +++ b/tests/Unit/Repositories/Eloquent/DatabaseRepositoryTest.php @@ -24,13 +24,13 @@ namespace Tests\Unit\Repositories\Eloquent; -use Illuminate\Database\Eloquent\Builder; use Mockery as m; -use Pterodactyl\Exceptions\DisplayException; -use Pterodactyl\Exceptions\Repository\DuplicateDatabaseNameException; -use Pterodactyl\Models\Database; -use Pterodactyl\Repositories\Eloquent\DatabaseRepository; use Tests\TestCase; +use Pterodactyl\Models\Database; +use Illuminate\Database\Eloquent\Builder; +use Pterodactyl\Exceptions\DisplayException; +use Pterodactyl\Repositories\Eloquent\DatabaseRepository; +use Pterodactyl\Exceptions\Repository\DuplicateDatabaseNameException; class DatabaseRepositoryTest extends TestCase { diff --git a/tests/Unit/Repositories/Eloquent/LocationRepositoryTest.php b/tests/Unit/Repositories/Eloquent/LocationRepositoryTest.php index fbc224fee..75113d85b 100644 --- a/tests/Unit/Repositories/Eloquent/LocationRepositoryTest.php +++ b/tests/Unit/Repositories/Eloquent/LocationRepositoryTest.php @@ -24,11 +24,11 @@ namespace Tests\Unit\Repositories\Eloquent; -use Illuminate\Database\Eloquent\Builder; use Mockery as m; -use Pterodactyl\Models\Location; -use Pterodactyl\Repositories\Eloquent\LocationRepository; use Tests\TestCase; +use Pterodactyl\Models\Location; +use Illuminate\Database\Eloquent\Builder; +use Pterodactyl\Repositories\Eloquent\LocationRepository; class LocationRepositoryTest extends TestCase { diff --git a/tests/Unit/Services/Database/DatabaseHostServiceTest.php b/tests/Unit/Services/Database/DatabaseHostServiceTest.php index 464d80ea9..bbba14537 100644 --- a/tests/Unit/Services/Database/DatabaseHostServiceTest.php +++ b/tests/Unit/Services/Database/DatabaseHostServiceTest.php @@ -25,13 +25,13 @@ namespace Tests\Unit\Services\Administrative; use Mockery as m; -use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface; -use Pterodactyl\Exceptions\DisplayException; use Tests\TestCase; use Illuminate\Database\DatabaseManager; +use Pterodactyl\Exceptions\DisplayException; use Illuminate\Contracts\Encryption\Encrypter; use Pterodactyl\Extensions\DynamicDatabaseConnection; use Pterodactyl\Services\Database\DatabaseHostService; +use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface; use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface; class DatabaseHostServiceTest extends TestCase diff --git a/tests/Unit/Services/Helpers/SoftwareVersionServiceTest.php b/tests/Unit/Services/Helpers/SoftwareVersionServiceTest.php index a3039694b..895530e69 100644 --- a/tests/Unit/Services/Helpers/SoftwareVersionServiceTest.php +++ b/tests/Unit/Services/Helpers/SoftwareVersionServiceTest.php @@ -25,10 +25,10 @@ namespace Tests\Unit\Services\Helpers; use Closure; -use GuzzleHttp\Client; use Mockery as m; -use Pterodactyl\Services\Helpers\SoftwareVersionService; use Tests\TestCase; +use GuzzleHttp\Client; +use Pterodactyl\Services\Helpers\SoftwareVersionService; use Illuminate\Contracts\Cache\Repository as CacheRepository; use Illuminate\Contracts\Config\Repository as ConfigRepository; @@ -64,7 +64,7 @@ class SoftwareVersionServiceTest extends TestCase protected $service; /** - * Setup tests + * Setup tests. */ public function setUp() { diff --git a/tests/Unit/Services/Packs/ExportPackServiceTest.php b/tests/Unit/Services/Packs/ExportPackServiceTest.php index 06674c7c0..416c27f48 100644 --- a/tests/Unit/Services/Packs/ExportPackServiceTest.php +++ b/tests/Unit/Services/Packs/ExportPackServiceTest.php @@ -24,14 +24,14 @@ namespace Tests\Unit\Services\Packs; -use Illuminate\Contracts\Filesystem\Factory; -use Mockery as m; -use phpmock\phpunit\PHPMock; -use Pterodactyl\Contracts\Repository\PackRepositoryInterface; -use Pterodactyl\Models\Pack; -use Pterodactyl\Services\Packs\ExportPackService; -use Tests\TestCase; use ZipArchive; +use Mockery as m; +use Tests\TestCase; +use phpmock\phpunit\PHPMock; +use Pterodactyl\Models\Pack; +use Illuminate\Contracts\Filesystem\Factory; +use Pterodactyl\Services\Packs\ExportPackService; +use Pterodactyl\Contracts\Repository\PackRepositoryInterface; class ExportPackServiceTest extends TestCase { diff --git a/tests/Unit/Services/Packs/PackCreationServiceTest.php b/tests/Unit/Services/Packs/PackCreationServiceTest.php index 7a21b7a99..9dc634baf 100644 --- a/tests/Unit/Services/Packs/PackCreationServiceTest.php +++ b/tests/Unit/Services/Packs/PackCreationServiceTest.php @@ -25,16 +25,16 @@ namespace Tests\Unit\Services\Packs; use Exception; -use Illuminate\Contracts\Filesystem\Factory; -use Illuminate\Http\UploadedFile; use Mockery as m; -use Illuminate\Database\ConnectionInterface; -use Pterodactyl\Contracts\Repository\PackRepositoryInterface; -use Pterodactyl\Exceptions\Service\Pack\InvalidFileMimeTypeException; -use Pterodactyl\Exceptions\Service\Pack\InvalidFileUploadException; -use Pterodactyl\Models\Pack; -use Pterodactyl\Services\Packs\PackCreationService; use Tests\TestCase; +use Pterodactyl\Models\Pack; +use Illuminate\Http\UploadedFile; +use Illuminate\Contracts\Filesystem\Factory; +use Illuminate\Database\ConnectionInterface; +use Pterodactyl\Services\Packs\PackCreationService; +use Pterodactyl\Contracts\Repository\PackRepositoryInterface; +use Pterodactyl\Exceptions\Service\Pack\InvalidFileUploadException; +use Pterodactyl\Exceptions\Service\Pack\InvalidFileMimeTypeException; class PackCreationServiceTest extends TestCase { diff --git a/tests/Unit/Services/Packs/PackDeletionServiceTest.php b/tests/Unit/Services/Packs/PackDeletionServiceTest.php index 74ec01d55..c6b2e4b3a 100644 --- a/tests/Unit/Services/Packs/PackDeletionServiceTest.php +++ b/tests/Unit/Services/Packs/PackDeletionServiceTest.php @@ -25,15 +25,15 @@ namespace Tests\Unit\Services\Packs; use Exception; +use Mockery as m; +use Tests\TestCase; +use Pterodactyl\Models\Pack; use Illuminate\Contracts\Filesystem\Factory; use Illuminate\Database\ConnectionInterface; -use Mockery as m; -use Pterodactyl\Contracts\Repository\PackRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; -use Pterodactyl\Exceptions\Service\HasActiveServersException; -use Pterodactyl\Models\Pack; use Pterodactyl\Services\Packs\PackDeletionService; -use Tests\TestCase; +use Pterodactyl\Contracts\Repository\PackRepositoryInterface; +use Pterodactyl\Exceptions\Service\HasActiveServersException; +use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; class PackDeletionServiceTest extends TestCase { diff --git a/tests/Unit/Services/Packs/PackUpdateServiceTest.php b/tests/Unit/Services/Packs/PackUpdateServiceTest.php index dffdecb9f..48ae8d779 100644 --- a/tests/Unit/Services/Packs/PackUpdateServiceTest.php +++ b/tests/Unit/Services/Packs/PackUpdateServiceTest.php @@ -25,12 +25,12 @@ namespace Tests\Unit\Services\Packs; use Mockery as m; -use Pterodactyl\Contracts\Repository\PackRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; -use Pterodactyl\Exceptions\Service\HasActiveServersException; +use Tests\TestCase; use Pterodactyl\Models\Pack; use Pterodactyl\Services\Packs\PackUpdateService; -use Tests\TestCase; +use Pterodactyl\Contracts\Repository\PackRepositoryInterface; +use Pterodactyl\Exceptions\Service\HasActiveServersException; +use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; class PackUpdateServiceTest extends TestCase { diff --git a/tests/Unit/Services/Packs/TemplateUploadServiceTest.php b/tests/Unit/Services/Packs/TemplateUploadServiceTest.php index f16583c75..bb1a564f0 100644 --- a/tests/Unit/Services/Packs/TemplateUploadServiceTest.php +++ b/tests/Unit/Services/Packs/TemplateUploadServiceTest.php @@ -24,18 +24,18 @@ namespace Tests\Unit\Services\Packs; -use Illuminate\Http\UploadedFile; +use ZipArchive; use Mockery as m; -use Pterodactyl\Exceptions\Service\Pack\InvalidFileMimeTypeException; -use Pterodactyl\Exceptions\Service\Pack\InvalidFileUploadException; -use Pterodactyl\Exceptions\Service\Pack\InvalidPackArchiveFormatException; -use Pterodactyl\Exceptions\Service\Pack\UnreadableZipArchiveException; -use Pterodactyl\Exceptions\Service\Pack\ZipExtractionException; +use Tests\TestCase; use Pterodactyl\Models\Pack; +use Illuminate\Http\UploadedFile; use Pterodactyl\Services\Packs\PackCreationService; use Pterodactyl\Services\Packs\TemplateUploadService; -use Tests\TestCase; -use ZipArchive; +use Pterodactyl\Exceptions\Service\Pack\ZipExtractionException; +use Pterodactyl\Exceptions\Service\Pack\InvalidFileUploadException; +use Pterodactyl\Exceptions\Service\Pack\InvalidFileMimeTypeException; +use Pterodactyl\Exceptions\Service\Pack\UnreadableZipArchiveException; +use Pterodactyl\Exceptions\Service\Pack\InvalidPackArchiveFormatException; class TemplateUploadServiceTest extends TestCase { diff --git a/tests/Unit/Services/Subusers/PermissionCreationServiceTest.php b/tests/Unit/Services/Subusers/PermissionCreationServiceTest.php index 85171448d..65407ce91 100644 --- a/tests/Unit/Services/Subusers/PermissionCreationServiceTest.php +++ b/tests/Unit/Services/Subusers/PermissionCreationServiceTest.php @@ -25,9 +25,9 @@ namespace Tests\Unit\Services\Subusers; use Mockery as m; -use Pterodactyl\Contracts\Repository\PermissionRepositoryInterface; -use Pterodactyl\Services\Subusers\PermissionCreationService; use Tests\TestCase; +use Pterodactyl\Services\Subusers\PermissionCreationService; +use Pterodactyl\Contracts\Repository\PermissionRepositoryInterface; class PermissionCreationServiceTest extends TestCase { diff --git a/tests/Unit/Services/Subusers/SubuserCreationServiceTest.php b/tests/Unit/Services/Subusers/SubuserCreationServiceTest.php index bf242cab4..bba981e13 100644 --- a/tests/Unit/Services/Subusers/SubuserCreationServiceTest.php +++ b/tests/Unit/Services/Subusers/SubuserCreationServiceTest.php @@ -24,23 +24,23 @@ namespace Tests\Unit\Services\Subusers; -use Illuminate\Database\ConnectionInterface; -use Illuminate\Log\Writer; use Mockery as m; +use Tests\TestCase; +use Illuminate\Log\Writer; use phpmock\phpunit\PHPMock; -use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; -use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; -use Pterodactyl\Contracts\Repository\UserRepositoryInterface; -use Pterodactyl\Exceptions\DisplayException; -use Pterodactyl\Exceptions\Service\Subuser\ServerSubuserExistsException; -use Pterodactyl\Exceptions\Service\Subuser\UserIsServerOwnerException; +use Pterodactyl\Models\User; use Pterodactyl\Models\Server; use Pterodactyl\Models\Subuser; -use Pterodactyl\Models\User; -use Pterodactyl\Services\Subusers\PermissionCreationService; -use Pterodactyl\Services\Subusers\SubuserCreationService; +use Illuminate\Database\ConnectionInterface; +use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Services\Users\CreationService; -use Tests\TestCase; +use Pterodactyl\Services\Subusers\SubuserCreationService; +use Pterodactyl\Services\Subusers\PermissionCreationService; +use Pterodactyl\Contracts\Repository\UserRepositoryInterface; +use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; +use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; +use Pterodactyl\Exceptions\Service\Subuser\UserIsServerOwnerException; +use Pterodactyl\Exceptions\Service\Subuser\ServerSubuserExistsException; use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; class SubuserCreationServiceTest extends TestCase @@ -200,7 +200,7 @@ class SubuserCreationServiceTest extends TestCase } /** - * Test that an exception gets thrown if the subuser is actually the server owner + * Test that an exception gets thrown if the subuser is actually the server owner. */ public function testExceptionIsThrownIfUserIsServerOwner() { @@ -237,6 +237,5 @@ class SubuserCreationServiceTest extends TestCase $this->assertInstanceOf(ServerSubuserExistsException::class, $exception); $this->assertEquals(trans('admin/exceptions.subusers.subuser_exists'), $exception->getMessage()); } - } } diff --git a/tests/Unit/Services/Subusers/SubuserDeletionServiceTest.php b/tests/Unit/Services/Subusers/SubuserDeletionServiceTest.php index 23d0155a1..25a976e47 100644 --- a/tests/Unit/Services/Subusers/SubuserDeletionServiceTest.php +++ b/tests/Unit/Services/Subusers/SubuserDeletionServiceTest.php @@ -24,16 +24,16 @@ namespace Tests\Unit\Services\Subusers; -use GuzzleHttp\Exception\RequestException; -use Illuminate\Database\ConnectionInterface; -use Illuminate\Log\Writer; use Mockery as m; -use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; -use Pterodactyl\Exceptions\DisplayException; +use Tests\TestCase; +use Illuminate\Log\Writer; use Pterodactyl\Models\Server; use Pterodactyl\Models\Subuser; +use GuzzleHttp\Exception\RequestException; +use Illuminate\Database\ConnectionInterface; +use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Services\Subusers\SubuserDeletionService; -use Tests\TestCase; +use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; class SubuserDeletionServiceTest extends TestCase @@ -135,5 +135,4 @@ class SubuserDeletionServiceTest extends TestCase $this->assertEquals(trans('admin/exceptions.daemon_connection_failed', ['code' => 'E_CONN_REFUSED']), $exception->getMessage()); } } - } diff --git a/tests/Unit/Services/Subusers/SubuserUpdateServiceTest.php b/tests/Unit/Services/Subusers/SubuserUpdateServiceTest.php index f4742f9c0..c053d57e7 100644 --- a/tests/Unit/Services/Subusers/SubuserUpdateServiceTest.php +++ b/tests/Unit/Services/Subusers/SubuserUpdateServiceTest.php @@ -24,18 +24,18 @@ namespace Tests\Unit\Services\Subusers; -use GuzzleHttp\Exception\RequestException; -use Illuminate\Database\ConnectionInterface; -use Illuminate\Log\Writer; use Mockery as m; -use Pterodactyl\Contracts\Repository\PermissionRepositoryInterface; -use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; -use Pterodactyl\Exceptions\DisplayException; +use Tests\TestCase; +use Illuminate\Log\Writer; use Pterodactyl\Models\Server; use Pterodactyl\Models\Subuser; -use Pterodactyl\Services\Subusers\PermissionCreationService; +use GuzzleHttp\Exception\RequestException; +use Illuminate\Database\ConnectionInterface; +use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Services\Subusers\SubuserUpdateService; -use Tests\TestCase; +use Pterodactyl\Services\Subusers\PermissionCreationService; +use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; +use Pterodactyl\Contracts\Repository\PermissionRepositoryInterface; use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; class SubuserUpdateServiceTest extends TestCase