diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index ba41dce6..ed83b200 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -3,10 +3,10 @@ namespace Pterodactyl\Exceptions; use Exception; -use Illuminate\Auth\AuthenticationException; -use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Prologue\Alerts\Facades\Alert; +use Illuminate\Auth\AuthenticationException; use Pterodactyl\Exceptions\Model\DataValidationException; +use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; class Handler extends ExceptionHandler { diff --git a/app/Extensions/DynamicDatabaseConnection.php b/app/Extensions/DynamicDatabaseConnection.php index 68081df2..3b5f1247 100644 --- a/app/Extensions/DynamicDatabaseConnection.php +++ b/app/Extensions/DynamicDatabaseConnection.php @@ -24,10 +24,10 @@ namespace Pterodactyl\Extensions; -use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface; use Pterodactyl\Models\DatabaseHost; use Illuminate\Contracts\Encryption\Encrypter; use Illuminate\Config\Repository as ConfigRepository; +use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface; class DynamicDatabaseConnection { diff --git a/app/Http/Controllers/API/User/ServerController.php b/app/Http/Controllers/API/User/ServerController.php index f7e652c2..dcdb7f6b 100644 --- a/app/Http/Controllers/API/User/ServerController.php +++ b/app/Http/Controllers/API/User/ServerController.php @@ -28,8 +28,8 @@ use Fractal; use Illuminate\Http\Request; use Pterodactyl\Models\Server; use Pterodactyl\Http\Controllers\Controller; -use Pterodactyl\Repositories\old_Daemon\PowerRepository; use Pterodactyl\Transformers\User\ServerTransformer; +use Pterodactyl\Repositories\old_Daemon\PowerRepository; use Pterodactyl\Repositories\old_Daemon\CommandRepository; class ServerController extends Controller diff --git a/app/Http/Controllers/Admin/LocationController.php b/app/Http/Controllers/Admin/LocationController.php index 4c33368a..a37d4c61 100644 --- a/app/Http/Controllers/Admin/LocationController.php +++ b/app/Http/Controllers/Admin/LocationController.php @@ -24,13 +24,13 @@ namespace Pterodactyl\Http\Controllers\Admin; -use Pterodactyl\Contracts\Repository\LocationRepositoryInterface; use Pterodactyl\Models\Location; use Prologue\Alerts\AlertsMessageBag; +use Pterodactyl\Services\LocationService; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Http\Requests\Admin\LocationRequest; -use Pterodactyl\Services\LocationService; +use Pterodactyl\Contracts\Repository\LocationRepositoryInterface; class LocationController extends Controller { diff --git a/app/Http/Controllers/Admin/NodesController.php b/app/Http/Controllers/Admin/NodesController.php index 76b83caf..74e6cfa0 100644 --- a/app/Http/Controllers/Admin/NodesController.php +++ b/app/Http/Controllers/Admin/NodesController.php @@ -24,26 +24,25 @@ namespace Pterodactyl\Http\Controllers\Admin; -use Illuminate\Cache\Repository as CacheRepository; -use Illuminate\Contracts\Translation\Translator; use Log; use Alert; -use Cache; use Javascript; -use Prologue\Alerts\AlertsMessageBag; -use Pterodactyl\Contracts\Repository\LocationRepositoryInterface; -use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; -use Pterodactyl\Http\Requests\Admin\NodeFormRequest; -use Pterodactyl\Models\Allocation; -use Pterodactyl\Models\Node; use Illuminate\Http\Request; +use Pterodactyl\Models\Node; +use Pterodactyl\Models\Allocation; +use Prologue\Alerts\AlertsMessageBag; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Repositories\NodeRepository; -use Pterodactyl\Exceptions\DisplayValidationException; +use Pterodactyl\Services\Nodes\UpdateService; use Pterodactyl\Services\Nodes\CreationService; use Pterodactyl\Services\Nodes\DeletionService; -use Pterodactyl\Services\Nodes\UpdateService; +use Illuminate\Contracts\Translation\Translator; +use Illuminate\Cache\Repository as CacheRepository; +use Pterodactyl\Http\Requests\Admin\NodeFormRequest; +use Pterodactyl\Exceptions\DisplayValidationException; +use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; +use Pterodactyl\Contracts\Repository\LocationRepositoryInterface; class NodesController extends Controller { diff --git a/app/Http/Controllers/Admin/ServersController.php b/app/Http/Controllers/Admin/ServersController.php index dd69f2d5..84b7ecbc 100644 --- a/app/Http/Controllers/Admin/ServersController.php +++ b/app/Http/Controllers/Admin/ServersController.php @@ -24,31 +24,30 @@ namespace Pterodactyl\Http\Controllers\Admin; -use Illuminate\Contracts\Config\Repository as ConfigRepository; -use Alert; use Javascript; -use Prologue\Alerts\AlertsMessageBag; -use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface; -use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface; -use Pterodactyl\Contracts\Repository\LocationRepositoryInterface; -use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface; -use Pterodactyl\Http\Requests\Admin\ServerFormRequest; -use Pterodactyl\Models\Server; use Illuminate\Http\Request; +use Pterodactyl\Models\Server; +use Prologue\Alerts\AlertsMessageBag; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Http\Controllers\Controller; -use Pterodactyl\Repositories\Eloquent\DatabaseHostRepository; -use Pterodactyl\Services\Database\DatabaseManagementService; -use Pterodactyl\Services\Servers\BuildModificationService; -use Pterodactyl\Services\Servers\ContainerRebuildService; use Pterodactyl\Services\Servers\CreationService; use Pterodactyl\Services\Servers\DeletionService; -use Pterodactyl\Services\Servers\DetailsModificationService; use Pterodactyl\Services\Servers\ReinstallService; -use Pterodactyl\Services\Servers\StartupModificationService; 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; +use Pterodactyl\Services\Servers\DetailsModificationService; +use Pterodactyl\Services\Servers\StartupModificationService; +use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; +use Pterodactyl\Repositories\Eloquent\DatabaseHostRepository; +use Illuminate\Contracts\Config\Repository as ConfigRepository; +use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; +use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface; +use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface; +use Pterodactyl\Contracts\Repository\LocationRepositoryInterface; +use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface; class ServersController extends Controller { diff --git a/app/Http/Controllers/Server/ServerController.php b/app/Http/Controllers/Server/ServerController.php index c15af88c..6b70a829 100644 --- a/app/Http/Controllers/Server/ServerController.php +++ b/app/Http/Controllers/Server/ServerController.php @@ -32,8 +32,8 @@ use Illuminate\Http\Request; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Repositories\ServerRepository; -use Pterodactyl\Repositories\old_Daemon\FileRepository; use Pterodactyl\Exceptions\DisplayValidationException; +use Pterodactyl\Repositories\old_Daemon\FileRepository; class ServerController extends Controller { diff --git a/app/Http/Requests/Admin/ServerFormRequest.php b/app/Http/Requests/Admin/ServerFormRequest.php index c521a2f8..c18d8c16 100644 --- a/app/Http/Requests/Admin/ServerFormRequest.php +++ b/app/Http/Requests/Admin/ServerFormRequest.php @@ -24,8 +24,8 @@ namespace Pterodactyl\Http\Requests\Admin; -use Illuminate\Validation\Rule; use Pterodactyl\Models\Server; +use Illuminate\Validation\Rule; class ServerFormRequest extends AdminFormRequest { diff --git a/app/Models/DatabaseHost.php b/app/Models/DatabaseHost.php index d9eb48ff..12b40474 100644 --- a/app/Models/DatabaseHost.php +++ b/app/Models/DatabaseHost.php @@ -80,11 +80,11 @@ class DatabaseHost extends Model implements ValidableContract 'node_id' => 'sometimes|required', ]; -/** - * Validation rules to assign to this model. - * - * @var array - */ + /** + * Validation rules to assign to this model. + * + * @var array + */ // @todo the node_id field doesn't validate correctly if no node is provided in request protected static $dataIntegrityRules = [ 'name' => 'string|max:255', diff --git a/app/Providers/RepositoryServiceProvider.php b/app/Providers/RepositoryServiceProvider.php index 38c16371..549a41af 100644 --- a/app/Providers/RepositoryServiceProvider.php +++ b/app/Providers/RepositoryServiceProvider.php @@ -25,34 +25,34 @@ namespace Pterodactyl\Providers; use Illuminate\Support\ServiceProvider; -use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface; -use Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface; -use Pterodactyl\Contracts\Repository\ApiPermissionRepositoryInterface; -use Pterodactyl\Contracts\Repository\Daemon\ConfigurationRepositoryInterface; -use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; -use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface; -use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface; -use Pterodactyl\Contracts\Repository\LocationRepositoryInterface; -use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; -use Pterodactyl\Contracts\Repository\OptionVariableRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServerVariableRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface; -use Pterodactyl\Repositories\Daemon\ConfigurationRepository; -use Pterodactyl\Repositories\Daemon\ServerRepository as DaemonServerRepository; -use Pterodactyl\Repositories\Eloquent\AllocationRepository; +use Pterodactyl\Repositories\Eloquent\NodeRepository; +use Pterodactyl\Repositories\Eloquent\UserRepository; use Pterodactyl\Repositories\Eloquent\ApiKeyRepository; -use Pterodactyl\Repositories\Eloquent\ApiPermissionRepository; -use Pterodactyl\Repositories\Eloquent\DatabaseHostRepository; +use Pterodactyl\Repositories\Eloquent\ServerRepository; +use Pterodactyl\Repositories\Eloquent\ServiceRepository; use Pterodactyl\Repositories\Eloquent\DatabaseRepository; use Pterodactyl\Repositories\Eloquent\LocationRepository; -use Pterodactyl\Repositories\Eloquent\NodeRepository; -use Pterodactyl\Repositories\Eloquent\OptionVariableRepository; -use Pterodactyl\Repositories\Eloquent\ServerRepository; -use Pterodactyl\Repositories\Eloquent\ServerVariableRepository; -use Pterodactyl\Repositories\Eloquent\ServiceRepository; -use Pterodactyl\Repositories\Eloquent\UserRepository; +use Pterodactyl\Repositories\Eloquent\AllocationRepository; +use Pterodactyl\Repositories\Daemon\ConfigurationRepository; +use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; use Pterodactyl\Contracts\Repository\UserRepositoryInterface; +use Pterodactyl\Repositories\Eloquent\DatabaseHostRepository; +use Pterodactyl\Repositories\Eloquent\ApiPermissionRepository; +use Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface; +use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; +use Pterodactyl\Repositories\Eloquent\OptionVariableRepository; +use Pterodactyl\Repositories\Eloquent\ServerVariableRepository; +use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface; +use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface; +use Pterodactyl\Contracts\Repository\LocationRepositoryInterface; +use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface; +use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface; +use Pterodactyl\Contracts\Repository\ApiPermissionRepositoryInterface; +use Pterodactyl\Contracts\Repository\OptionVariableRepositoryInterface; +use Pterodactyl\Contracts\Repository\ServerVariableRepositoryInterface; +use Pterodactyl\Contracts\Repository\Daemon\ConfigurationRepositoryInterface; +use Pterodactyl\Repositories\Daemon\ServerRepository as DaemonServerRepository; +use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; class RepositoryServiceProvider extends ServiceProvider { diff --git a/app/Repositories/Daemon/BaseRepository.php b/app/Repositories/Daemon/BaseRepository.php index 8a637e9f..43e2e229 100644 --- a/app/Repositories/Daemon/BaseRepository.php +++ b/app/Repositories/Daemon/BaseRepository.php @@ -26,9 +26,9 @@ namespace Pterodactyl\Repositories\Daemon; use GuzzleHttp\Client; use Illuminate\Foundation\Application; -use Pterodactyl\Contracts\Repository\Daemon\BaseRepositoryInterface; use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; use Illuminate\Contracts\Config\Repository as ConfigRepository; +use Pterodactyl\Contracts\Repository\Daemon\BaseRepositoryInterface; class BaseRepository implements BaseRepositoryInterface { diff --git a/app/Repositories/Daemon/ServerRepository.php b/app/Repositories/Daemon/ServerRepository.php index 359963eb..c1cbee1c 100644 --- a/app/Repositories/Daemon/ServerRepository.php +++ b/app/Repositories/Daemon/ServerRepository.php @@ -24,9 +24,9 @@ namespace Pterodactyl\Repositories\Daemon; +use Pterodactyl\Services\Servers\EnvironmentService; use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface as DatabaseServerRepositoryInterface; -use Pterodactyl\Services\Servers\EnvironmentService; class ServerRepository extends BaseRepository implements ServerRepositoryInterface { diff --git a/app/Repositories/Eloquent/DatabaseHostRepository.php b/app/Repositories/Eloquent/DatabaseHostRepository.php index 8a4d7b3c..6cb48bbf 100644 --- a/app/Repositories/Eloquent/DatabaseHostRepository.php +++ b/app/Repositories/Eloquent/DatabaseHostRepository.php @@ -24,10 +24,10 @@ namespace Pterodactyl\Repositories\Eloquent; -use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface; +use Pterodactyl\Models\DatabaseHost; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Exceptions\Repository\RecordNotFoundException; -use Pterodactyl\Models\DatabaseHost; +use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface; class DatabaseHostRepository extends EloquentRepository implements DatabaseHostRepositoryInterface { diff --git a/app/Repositories/Eloquent/DatabaseRepository.php b/app/Repositories/Eloquent/DatabaseRepository.php index 0e2bd6c1..347c6b9d 100644 --- a/app/Repositories/Eloquent/DatabaseRepository.php +++ b/app/Repositories/Eloquent/DatabaseRepository.php @@ -24,9 +24,9 @@ namespace Pterodactyl\Repositories\Eloquent; -use Illuminate\Database\DatabaseManager; use Pterodactyl\Models\Database; use Illuminate\Foundation\Application; +use Illuminate\Database\DatabaseManager; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface; diff --git a/app/Repositories/Eloquent/NodeRepository.php b/app/Repositories/Eloquent/NodeRepository.php index 2e18b1d4..7375570e 100644 --- a/app/Repositories/Eloquent/NodeRepository.php +++ b/app/Repositories/Eloquent/NodeRepository.php @@ -24,9 +24,9 @@ namespace Pterodactyl\Repositories\Eloquent; +use Pterodactyl\Models\Node; use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; use Pterodactyl\Exceptions\Repository\RecordNotFoundException; -use Pterodactyl\Models\Node; use Pterodactyl\Repositories\Eloquent\Attributes\SearchableRepository; class NodeRepository extends SearchableRepository implements NodeRepositoryInterface diff --git a/app/Repositories/Eloquent/ServiceRepository.php b/app/Repositories/Eloquent/ServiceRepository.php index 6fd8a4bc..aca36490 100644 --- a/app/Repositories/Eloquent/ServiceRepository.php +++ b/app/Repositories/Eloquent/ServiceRepository.php @@ -24,9 +24,9 @@ namespace Pterodactyl\Repositories\Eloquent; -use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface; -use Pterodactyl\Exceptions\Repository\RecordNotFoundException; use Pterodactyl\Models\Service; +use Pterodactyl\Exceptions\Repository\RecordNotFoundException; +use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface; class ServiceRepository extends EloquentRepository implements ServiceRepositoryInterface { diff --git a/app/Repositories/Eloquent/UserRepository.php b/app/Repositories/Eloquent/UserRepository.php index 633b92fd..e7dfab60 100644 --- a/app/Repositories/Eloquent/UserRepository.php +++ b/app/Repositories/Eloquent/UserRepository.php @@ -24,10 +24,10 @@ namespace Pterodactyl\Repositories\Eloquent; -use Illuminate\Contracts\Config\Repository as ConfigRepository; +use Pterodactyl\Models\User; use Illuminate\Foundation\Application; use Pterodactyl\Contracts\Repository\UserRepositoryInterface; -use Pterodactyl\Models\User; +use Illuminate\Contracts\Config\Repository as ConfigRepository; use Pterodactyl\Repositories\Eloquent\Attributes\SearchableRepository; class UserRepository extends SearchableRepository implements UserRepositoryInterface diff --git a/app/Services/Database/DatabaseHostService.php b/app/Services/Database/DatabaseHostService.php index 94170d83..33d46c31 100644 --- a/app/Services/Database/DatabaseHostService.php +++ b/app/Services/Database/DatabaseHostService.php @@ -24,8 +24,8 @@ namespace Pterodactyl\Services\Database; -use Illuminate\Contracts\Encryption\Encrypter; use Illuminate\Database\DatabaseManager; +use Illuminate\Contracts\Encryption\Encrypter; use Pterodactyl\Extensions\DynamicDatabaseConnection; use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface; diff --git a/app/Services/Nodes/DeletionService.php b/app/Services/Nodes/DeletionService.php index 1b57c591..519aed42 100644 --- a/app/Services/Nodes/DeletionService.php +++ b/app/Services/Nodes/DeletionService.php @@ -24,11 +24,11 @@ namespace Pterodactyl\Services\Nodes; -use Illuminate\Contracts\Translation\Translator; -use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; -use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; -use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Models\Node; +use Pterodactyl\Exceptions\DisplayException; +use Illuminate\Contracts\Translation\Translator; +use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; +use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; class DeletionService { diff --git a/app/Services/Nodes/UpdateService.php b/app/Services/Nodes/UpdateService.php index 58336793..e34c9ff2 100644 --- a/app/Services/Nodes/UpdateService.php +++ b/app/Services/Nodes/UpdateService.php @@ -24,12 +24,12 @@ namespace Pterodactyl\Services\Nodes; -use GuzzleHttp\Exception\RequestException; use Illuminate\Log\Writer; -use Pterodactyl\Contracts\Repository\Daemon\ConfigurationRepositoryInterface; -use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; -use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Models\Node; +use GuzzleHttp\Exception\RequestException; +use Pterodactyl\Exceptions\DisplayException; +use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; +use Pterodactyl\Contracts\Repository\Daemon\ConfigurationRepositoryInterface; class UpdateService { diff --git a/app/Services/Servers/BuildModificationService.php b/app/Services/Servers/BuildModificationService.php index 19ce0c3a..24c52a16 100644 --- a/app/Services/Servers/BuildModificationService.php +++ b/app/Services/Servers/BuildModificationService.php @@ -24,15 +24,15 @@ namespace Pterodactyl\Services\Servers; +use Illuminate\Log\Writer; +use Pterodactyl\Models\Server; use GuzzleHttp\Exception\RequestException; use Illuminate\Database\ConnectionInterface; -use Illuminate\Log\Writer; -use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface; -use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Exceptions\Repository\RecordNotFoundException; -use Pterodactyl\Models\Server; +use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; +use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface; +use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; class BuildModificationService { diff --git a/app/Services/Servers/ContainerRebuildService.php b/app/Services/Servers/ContainerRebuildService.php index 20ce9e0b..d6e63268 100644 --- a/app/Services/Servers/ContainerRebuildService.php +++ b/app/Services/Servers/ContainerRebuildService.php @@ -24,12 +24,12 @@ namespace Pterodactyl\Services\Servers; -use GuzzleHttp\Exception\RequestException; use Illuminate\Log\Writer; +use Pterodactyl\Models\Server; +use GuzzleHttp\Exception\RequestException; +use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; -use Pterodactyl\Exceptions\DisplayException; -use Pterodactyl\Models\Server; class ContainerRebuildService { diff --git a/app/Services/Servers/CreationService.php b/app/Services/Servers/CreationService.php index 5c641d2d..96e1527d 100644 --- a/app/Services/Servers/CreationService.php +++ b/app/Services/Servers/CreationService.php @@ -24,11 +24,11 @@ namespace Pterodactyl\Services\Servers; -use GuzzleHttp\Exception\RequestException; -use Illuminate\Log\Writer; -use Pterodactyl\Exceptions\DisplayException; use Ramsey\Uuid\Uuid; +use Illuminate\Log\Writer; use Illuminate\Database\DatabaseManager; +use GuzzleHttp\Exception\RequestException; +use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; use Pterodactyl\Contracts\Repository\UserRepositoryInterface; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; diff --git a/app/Services/Servers/DetailsModificationService.php b/app/Services/Servers/DetailsModificationService.php index c2897021..7b1aac37 100644 --- a/app/Services/Servers/DetailsModificationService.php +++ b/app/Services/Servers/DetailsModificationService.php @@ -24,11 +24,11 @@ namespace Pterodactyl\Services\Servers; -use GuzzleHttp\Exception\RequestException; -use Illuminate\Database\DatabaseManager; use Illuminate\Log\Writer; -use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Models\Server; +use Illuminate\Database\DatabaseManager; +use GuzzleHttp\Exception\RequestException; +use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Repositories\Eloquent\ServerRepository; use Pterodactyl\Repositories\Daemon\ServerRepository as DaemonServerRepository; diff --git a/app/Services/Servers/ReinstallService.php b/app/Services/Servers/ReinstallService.php index 5b1b24dd..f9b0f16e 100644 --- a/app/Services/Servers/ReinstallService.php +++ b/app/Services/Servers/ReinstallService.php @@ -24,11 +24,11 @@ namespace Pterodactyl\Services\Servers; -use GuzzleHttp\Exception\RequestException; use Illuminate\Log\Writer; -use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Models\Server; +use GuzzleHttp\Exception\RequestException; use Illuminate\Database\ConnectionInterface; +use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; diff --git a/app/Services/Servers/StartupModificationService.php b/app/Services/Servers/StartupModificationService.php index 00eaaafd..8c3ffa5c 100644 --- a/app/Services/Servers/StartupModificationService.php +++ b/app/Services/Servers/StartupModificationService.php @@ -24,14 +24,14 @@ namespace Pterodactyl\Services\Servers; +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\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\ServerVariableRepositoryInterface; -use Pterodactyl\Exceptions\DisplayException; -use Pterodactyl\Models\Server; +use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; class StartupModificationService { diff --git a/app/Services/Servers/SuspensionService.php b/app/Services/Servers/SuspensionService.php index 96462db3..63f4aaca 100644 --- a/app/Services/Servers/SuspensionService.php +++ b/app/Services/Servers/SuspensionService.php @@ -24,13 +24,13 @@ namespace Pterodactyl\Services\Servers; +use Illuminate\Log\Writer; +use Pterodactyl\Models\Server; use GuzzleHttp\Exception\RequestException; use Illuminate\Database\ConnectionInterface; -use Illuminate\Log\Writer; +use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; -use Pterodactyl\Exceptions\DisplayException; -use Pterodactyl\Models\Server; class SuspensionService { diff --git a/app/Services/Servers/VariableValidatorService.php b/app/Services/Servers/VariableValidatorService.php index d0bb2ccd..1904f675 100644 --- a/app/Services/Servers/VariableValidatorService.php +++ b/app/Services/Servers/VariableValidatorService.php @@ -24,11 +24,11 @@ namespace Pterodactyl\Services\Servers; -use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServerVariableRepositoryInterface; use Pterodactyl\Exceptions\DisplayValidationException; +use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Illuminate\Contracts\Validation\Factory as ValidationFactory; use Pterodactyl\Contracts\Repository\OptionVariableRepositoryInterface; +use Pterodactyl\Contracts\Repository\ServerVariableRepositoryInterface; class VariableValidatorService { diff --git a/app/Services/Users/DeletionService.php b/app/Services/Users/DeletionService.php index 2c97c203..ab88068f 100644 --- a/app/Services/Users/DeletionService.php +++ b/app/Services/Users/DeletionService.php @@ -24,11 +24,11 @@ namespace Pterodactyl\Services\Users; -use Illuminate\Contracts\Translation\Translator; -use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; -use Pterodactyl\Contracts\Repository\UserRepositoryInterface; -use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Models\User; +use Pterodactyl\Exceptions\DisplayException; +use Illuminate\Contracts\Translation\Translator; +use Pterodactyl\Contracts\Repository\UserRepositoryInterface; +use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; class DeletionService { diff --git a/tests/Unit/Services/Api/KeyServiceTest.php b/tests/Unit/Services/Api/KeyServiceTest.php index ef48277a..33d01cb0 100644 --- a/tests/Unit/Services/Api/KeyServiceTest.php +++ b/tests/Unit/Services/Api/KeyServiceTest.php @@ -24,14 +24,14 @@ namespace Tests\Unit\Services\Api; -use Illuminate\Contracts\Encryption\Encrypter; -use Illuminate\Database\ConnectionInterface; use Mockery as m; -use phpmock\phpunit\PHPMock; -use Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface; -use Pterodactyl\Services\Api\KeyService; -use Pterodactyl\Services\Api\PermissionService; use Tests\TestCase; +use phpmock\phpunit\PHPMock; +use Pterodactyl\Services\Api\KeyService; +use Illuminate\Database\ConnectionInterface; +use Illuminate\Contracts\Encryption\Encrypter; +use Pterodactyl\Services\Api\PermissionService; +use Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface; class KeyServiceTest extends TestCase { diff --git a/tests/Unit/Services/Api/PermissionServiceTest.php b/tests/Unit/Services/Api/PermissionServiceTest.php index 5c687c9b..98e3bf0b 100644 --- a/tests/Unit/Services/Api/PermissionServiceTest.php +++ b/tests/Unit/Services/Api/PermissionServiceTest.php @@ -25,10 +25,10 @@ namespace Tests\Unit\Services; use Mockery as m; -use Pterodactyl\Contracts\Repository\ApiPermissionRepositoryInterface; +use Tests\TestCase; use Pterodactyl\Models\APIPermission; use Pterodactyl\Services\Api\PermissionService; -use Tests\TestCase; +use Pterodactyl\Contracts\Repository\ApiPermissionRepositoryInterface; class PermissionServiceTest extends TestCase { diff --git a/tests/Unit/Services/Database/DatabaseHostServiceTest.php b/tests/Unit/Services/Database/DatabaseHostServiceTest.php index fae03862..84df7f02 100644 --- a/tests/Unit/Services/Database/DatabaseHostServiceTest.php +++ b/tests/Unit/Services/Database/DatabaseHostServiceTest.php @@ -156,7 +156,7 @@ class DatabaseHostServiceTest extends TestCase } /** - * Test that passing no or empty password will skip storing it + * Test that passing no or empty password will skip storing it. */ public function test_update_without_password() { diff --git a/tests/Unit/Services/Nodes/CreationServiceTest.php b/tests/Unit/Services/Nodes/CreationServiceTest.php index 5932e709..84efcbde 100644 --- a/tests/Unit/Services/Nodes/CreationServiceTest.php +++ b/tests/Unit/Services/Nodes/CreationServiceTest.php @@ -25,10 +25,10 @@ namespace Tests\Unit\Services\Nodes; use Mockery as m; -use phpmock\phpunit\PHPMock; -use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; -use Pterodactyl\Services\Nodes\CreationService; use Tests\TestCase; +use phpmock\phpunit\PHPMock; +use Pterodactyl\Services\Nodes\CreationService; +use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; class CreationServiceTest extends TestCase { diff --git a/tests/Unit/Services/Nodes/DeletionServiceTest.php b/tests/Unit/Services/Nodes/DeletionServiceTest.php index 266fbc37..845117db 100644 --- a/tests/Unit/Services/Nodes/DeletionServiceTest.php +++ b/tests/Unit/Services/Nodes/DeletionServiceTest.php @@ -24,13 +24,13 @@ namespace Tests\Unit\Services\Nodes; -use Illuminate\Contracts\Translation\Translator; use Mockery as m; -use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; +use Tests\TestCase; use Pterodactyl\Models\Node; use Pterodactyl\Services\Nodes\DeletionService; -use Tests\TestCase; +use Illuminate\Contracts\Translation\Translator; +use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; +use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; class DeletionServiceTest extends TestCase { diff --git a/tests/Unit/Services/Nodes/UpdateServiceTest.php b/tests/Unit/Services/Nodes/UpdateServiceTest.php index 9bccf2d4..74db802b 100644 --- a/tests/Unit/Services/Nodes/UpdateServiceTest.php +++ b/tests/Unit/Services/Nodes/UpdateServiceTest.php @@ -25,17 +25,17 @@ namespace Tests\Unit\Services\Nodes; use Exception; -use GuzzleHttp\Exception\RequestException; -use Illuminate\Log\Writer; use Mockery as m; -use phpmock\phpunit\PHPMock; -use Pterodactyl\Contracts\Repository\Daemon\ConfigurationRepositoryInterface; -use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; -use Pterodactyl\Exceptions\DisplayException; -use Pterodactyl\Models\Node; -use Pterodactyl\Services\Nodes\CreationService; -use Pterodactyl\Services\Nodes\UpdateService; use Tests\TestCase; +use Illuminate\Log\Writer; +use phpmock\phpunit\PHPMock; +use Pterodactyl\Models\Node; +use GuzzleHttp\Exception\RequestException; +use Pterodactyl\Exceptions\DisplayException; +use Pterodactyl\Services\Nodes\UpdateService; +use Pterodactyl\Services\Nodes\CreationService; +use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; +use Pterodactyl\Contracts\Repository\Daemon\ConfigurationRepositoryInterface; class UpdateServiceTest extends TestCase { diff --git a/tests/Unit/Services/Servers/ContainerRebuildServiceTest.php b/tests/Unit/Services/Servers/ContainerRebuildServiceTest.php index fac637c5..ad18baa4 100644 --- a/tests/Unit/Services/Servers/ContainerRebuildServiceTest.php +++ b/tests/Unit/Services/Servers/ContainerRebuildServiceTest.php @@ -25,13 +25,13 @@ namespace Tests\Unit\Services\Servers; use Exception; -use GuzzleHttp\Exception\RequestException; -use Illuminate\Log\Writer; use Mockery as m; -use Pterodactyl\Exceptions\DisplayException; -use Pterodactyl\Models\Server; -use Pterodactyl\Services\Servers\ContainerRebuildService; use Tests\TestCase; +use Illuminate\Log\Writer; +use Pterodactyl\Models\Server; +use GuzzleHttp\Exception\RequestException; +use Pterodactyl\Exceptions\DisplayException; +use Pterodactyl\Services\Servers\ContainerRebuildService; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; @@ -133,7 +133,7 @@ class ContainerRebuildServiceTest extends TestCase } catch (Exception $exception) { $this->assertInstanceOf(DisplayException::class, $exception); $this->assertEquals( - trans('admin/server.exceptions.daemon_exception', ['code' => 400,]), $exception->getMessage() + trans('admin/server.exceptions.daemon_exception', ['code' => 400]), $exception->getMessage() ); } } diff --git a/tests/Unit/Services/Servers/CreationServiceTest.php b/tests/Unit/Services/Servers/CreationServiceTest.php index 284d9c28..dad92475 100644 --- a/tests/Unit/Services/Servers/CreationServiceTest.php +++ b/tests/Unit/Services/Servers/CreationServiceTest.php @@ -24,20 +24,20 @@ namespace Tests\Unit\Services\Servers; -use Illuminate\Log\Writer; use Mockery as m; -use phpmock\phpunit\PHPMock; -use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServerVariableRepositoryInterface; -use Pterodactyl\Contracts\Repository\UserRepositoryInterface; -use Pterodactyl\Services\Servers\CreationService; -use Pterodactyl\Services\Servers\UsernameGenerationService; -use Pterodactyl\Services\Servers\VariableValidatorService; -use Ramsey\Uuid\Uuid; use Tests\TestCase; +use Ramsey\Uuid\Uuid; +use Illuminate\Log\Writer; +use phpmock\phpunit\PHPMock; use Illuminate\Database\DatabaseManager; +use Pterodactyl\Services\Servers\CreationService; +use Pterodactyl\Services\Servers\VariableValidatorService; +use Pterodactyl\Services\Servers\UsernameGenerationService; +use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; +use Pterodactyl\Contracts\Repository\UserRepositoryInterface; +use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface; +use Pterodactyl\Contracts\Repository\ServerVariableRepositoryInterface; use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; class CreationServiceTest extends TestCase diff --git a/tests/Unit/Services/Servers/DetailsModificationServiceTest.php b/tests/Unit/Services/Servers/DetailsModificationServiceTest.php index 37164b4f..a617fbaa 100644 --- a/tests/Unit/Services/Servers/DetailsModificationServiceTest.php +++ b/tests/Unit/Services/Servers/DetailsModificationServiceTest.php @@ -25,9 +25,9 @@ namespace Tests\Unit\Services\Servers; use Exception; -use Illuminate\Log\Writer; use Mockery as m; use Tests\TestCase; +use Illuminate\Log\Writer; use phpmock\phpunit\PHPMock; use Pterodactyl\Models\Server; use Illuminate\Database\DatabaseManager; @@ -258,7 +258,7 @@ class DetailsModificationServiceTest extends TestCase } catch (Exception $exception) { $this->assertInstanceOf(DisplayException::class, $exception); $this->assertEquals( - trans('admin/server.exceptions.daemon_exception', ['code' => 400,]), $exception->getMessage() + trans('admin/server.exceptions.daemon_exception', ['code' => 400]), $exception->getMessage() ); } } @@ -371,7 +371,7 @@ class DetailsModificationServiceTest extends TestCase } catch (Exception $exception) { $this->assertInstanceOf(DisplayException::class, $exception); $this->assertEquals( - trans('admin/server.exceptions.daemon_exception', ['code' => 400,]), $exception->getMessage() + trans('admin/server.exceptions.daemon_exception', ['code' => 400]), $exception->getMessage() ); } } diff --git a/tests/Unit/Services/Servers/ReinstallServiceTest.php b/tests/Unit/Services/Servers/ReinstallServiceTest.php index ee023012..a2fee951 100644 --- a/tests/Unit/Services/Servers/ReinstallServiceTest.php +++ b/tests/Unit/Services/Servers/ReinstallServiceTest.php @@ -25,14 +25,14 @@ namespace Tests\Unit\Services\Servers; use Exception; +use Mockery as m; +use Tests\TestCase; +use Illuminate\Log\Writer; +use Pterodactyl\Models\Server; use GuzzleHttp\Exception\RequestException; use Illuminate\Database\ConnectionInterface; -use Illuminate\Log\Writer; -use Mockery as m; use Pterodactyl\Exceptions\DisplayException; -use Pterodactyl\Models\Server; use Pterodactyl\Services\Servers\ReinstallService; -use Tests\TestCase; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; @@ -162,7 +162,7 @@ class ReinstallServiceTest extends TestCase } catch (Exception $exception) { $this->assertInstanceOf(DisplayException::class, $exception); $this->assertEquals( - trans('admin/server.exceptions.daemon_exception', ['code' => 400,]), $exception->getMessage() + trans('admin/server.exceptions.daemon_exception', ['code' => 400]), $exception->getMessage() ); } } diff --git a/tests/Unit/Services/Servers/SuspensionServiceTest.php b/tests/Unit/Services/Servers/SuspensionServiceTest.php index 0347038e..3445e02b 100644 --- a/tests/Unit/Services/Servers/SuspensionServiceTest.php +++ b/tests/Unit/Services/Servers/SuspensionServiceTest.php @@ -25,16 +25,16 @@ namespace Tests\Unit\Services\Servers; use Exception; +use Mockery as m; +use Tests\TestCase; +use Illuminate\Log\Writer; +use Pterodactyl\Models\Server; use GuzzleHttp\Exception\RequestException; use Illuminate\Database\ConnectionInterface; -use Illuminate\Log\Writer; -use Mockery as m; -use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Exceptions\DisplayException; -use Pterodactyl\Models\Server; use Pterodactyl\Services\Servers\SuspensionService; -use Tests\TestCase; +use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; +use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; class SuspensionServiceTest extends TestCase { @@ -127,9 +127,8 @@ class SuspensionServiceTest extends TestCase $this->assertTrue($this->service->toggle($this->server)); } - /** - * Test that server is unsuspended if action=unsuspend + * Test that server is unsuspended if action=unsuspend. */ public function testServerShouldBeUnsuspendedWhenUnsuspendActionIsPassed() { @@ -148,7 +147,7 @@ class SuspensionServiceTest extends TestCase } /** - * Test that nothing happens if a server is already unsuspended and action=unsuspend + * Test that nothing happens if a server is already unsuspended and action=unsuspend. */ public function testNoActionShouldHappenIfServerIsAlreadyUnsuspendedAndActionIsUnsuspend() { @@ -158,7 +157,7 @@ class SuspensionServiceTest extends TestCase } /** - * Test that nothing happens if a server is already suspended and action=suspend + * Test that nothing happens if a server is already suspended and action=suspend. */ public function testNoActionShouldHappenIfServerIsAlreadySuspendedAndActionIsSuspend() { @@ -191,7 +190,7 @@ class SuspensionServiceTest extends TestCase } catch (Exception $exception) { $this->assertInstanceOf(DisplayException::class, $exception); $this->assertEquals( - trans('admin/server.exceptions.daemon_exception', ['code' => 400,]), $exception->getMessage() + trans('admin/server.exceptions.daemon_exception', ['code' => 400]), $exception->getMessage() ); } } diff --git a/tests/Unit/Services/Servers/VariableValidatorServiceTest.php b/tests/Unit/Services/Servers/VariableValidatorServiceTest.php index 60e8705a..c6b6a0a4 100644 --- a/tests/Unit/Services/Servers/VariableValidatorServiceTest.php +++ b/tests/Unit/Services/Servers/VariableValidatorServiceTest.php @@ -149,15 +149,15 @@ class VariableValidatorServiceTest extends TestCase $this->validator->shouldReceive('make')->with([ 'variable_value' => 'Test_SomeValue_0', ], [ - 'variable_value' => $this->variables{0}->rules, + 'variable_value' => $this->variables[0]->rules, ])->once()->andReturnSelf() ->shouldReceive('fails')->withNoArgs()->once()->andReturn(false); $response = $this->service->setFields([ - $this->variables{0}->env_variable => 'Test_SomeValue_0', - $this->variables{1}->env_variable => 'Test_SomeValue_1', - $this->variables{2}->env_variable => 'Test_SomeValue_2', - $this->variables{3}->env_variable => 'Test_SomeValue_3', + $this->variables[0]->env_variable => 'Test_SomeValue_0', + $this->variables[1]->env_variable => 'Test_SomeValue_1', + $this->variables[2]->env_variable => 'Test_SomeValue_2', + $this->variables[3]->env_variable => 'Test_SomeValue_3', ])->validate(1)->getResults(); $this->assertEquals(1, count($response), 'Assert response has a single item in array.'); @@ -166,8 +166,8 @@ class VariableValidatorServiceTest extends TestCase $this->assertArrayHasKey('key', $response[0]); $this->assertArrayHasKey('value', $response[0]); - $this->assertEquals($this->variables{0}->id, $response[0]['id']); - $this->assertEquals($this->variables{0}->env_variable, $response[0]['key']); + $this->assertEquals($this->variables[0]->id, $response[0]['id']); + $this->assertEquals($this->variables[0]->env_variable, $response[0]['key']); $this->assertEquals('Test_SomeValue_0', $response[0]['value']); } @@ -178,32 +178,32 @@ class VariableValidatorServiceTest extends TestCase { $this->optionVariableRepository->shouldReceive('findWhere')->with([['option_id', '=', 1]])->andReturn($this->variables); - foreach($this->variables as $key => $variable) { + foreach ($this->variables as $key => $variable) { $this->validator->shouldReceive('make')->with([ 'variable_value' => 'Test_SomeValue_' . $key, ], [ - 'variable_value' => $this->variables{$key}->rules, + 'variable_value' => $this->variables[$key]->rules, ])->andReturnSelf() ->shouldReceive('fails')->withNoArgs()->once()->andReturn(false); } $response = $this->service->isAdmin()->setFields([ - $this->variables{0}->env_variable => 'Test_SomeValue_0', - $this->variables{1}->env_variable => 'Test_SomeValue_1', - $this->variables{2}->env_variable => 'Test_SomeValue_2', - $this->variables{3}->env_variable => 'Test_SomeValue_3', + $this->variables[0]->env_variable => 'Test_SomeValue_0', + $this->variables[1]->env_variable => 'Test_SomeValue_1', + $this->variables[2]->env_variable => 'Test_SomeValue_2', + $this->variables[3]->env_variable => 'Test_SomeValue_3', ])->validate(1)->getResults(); $this->assertEquals(4, count($response), 'Assert response has all four items in array.'); - foreach($response as $key => $values) { + foreach ($response as $key => $values) { $this->assertArrayHasKey($key, $response); $this->assertArrayHasKey('id', $response[$key]); $this->assertArrayHasKey('key', $response[$key]); $this->assertArrayHasKey('value', $response[$key]); - $this->assertEquals($this->variables{$key}->id, $response[$key]['id']); - $this->assertEquals($this->variables{$key}->env_variable, $response[$key]['key']); + $this->assertEquals($this->variables[$key]->id, $response[$key]['id']); + $this->assertEquals($this->variables[$key]->env_variable, $response[$key]['key']); $this->assertEquals('Test_SomeValue_' . $key, $response[$key]['value']); } } @@ -218,7 +218,7 @@ class VariableValidatorServiceTest extends TestCase $this->validator->shouldReceive('make')->with([ 'variable_value' => null, ], [ - 'variable_value' => $this->variables{0}->rules, + 'variable_value' => $this->variables[0]->rules, ])->once()->andReturnSelf() ->shouldReceive('fails')->withNoArgs()->once()->andReturn(true); @@ -227,7 +227,7 @@ class VariableValidatorServiceTest extends TestCase try { $this->service->setFields([ - $this->variables{0}->env_variable => null, + $this->variables[0]->env_variable => null, ])->validate(1); } catch (DisplayValidationException $exception) { $decoded = json_decode($exception->getMessage()); @@ -235,7 +235,7 @@ class VariableValidatorServiceTest extends TestCase $this->assertEquals(0, json_last_error(), 'Assert that response is decodable JSON.'); $this->assertObjectHasAttribute('notice', $decoded); $this->assertEquals( - trans('admin/server.exceptions.bad_variable', ['name' => $this->variables{0}->name]), + trans('admin/server.exceptions.bad_variable', ['name' => $this->variables[0]->name]), $decoded->notice[0] ); } diff --git a/tests/Unit/Services/Users/CreationServiceTest.php b/tests/Unit/Services/Users/CreationServiceTest.php index 59067f9d..ac18c2ed 100644 --- a/tests/Unit/Services/Users/CreationServiceTest.php +++ b/tests/Unit/Services/Users/CreationServiceTest.php @@ -25,13 +25,13 @@ namespace Tests\Unit\Services; use Mockery as m; -use Pterodactyl\Services\Users\CreationService; use Tests\TestCase; use Illuminate\Foundation\Application; use Illuminate\Contracts\Hashing\Hasher; use Illuminate\Database\ConnectionInterface; use Illuminate\Notifications\ChannelManager; use Pterodactyl\Notifications\AccountCreated; +use Pterodactyl\Services\Users\CreationService; use Pterodactyl\Services\Helpers\TemporaryPasswordService; use Pterodactyl\Contracts\Repository\UserRepositoryInterface; diff --git a/tests/Unit/Services/Users/DeletionServiceTest.php b/tests/Unit/Services/Users/DeletionServiceTest.php index f067a7e0..e98a375f 100644 --- a/tests/Unit/Services/Users/DeletionServiceTest.php +++ b/tests/Unit/Services/Users/DeletionServiceTest.php @@ -24,13 +24,13 @@ namespace Tests\Unit\Services\Users; -use Illuminate\Contracts\Translation\Translator; use Mockery as m; -use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; -use Pterodactyl\Contracts\Repository\UserRepositoryInterface; +use Tests\TestCase; use Pterodactyl\Models\User; use Pterodactyl\Services\Users\DeletionService; -use Tests\TestCase; +use Illuminate\Contracts\Translation\Translator; +use Pterodactyl\Contracts\Repository\UserRepositoryInterface; +use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; class DeletionServiceTest extends TestCase { diff --git a/tests/Unit/Services/Users/UpdateServiceTest.php b/tests/Unit/Services/Users/UpdateServiceTest.php index 399a2f85..2a5bd295 100644 --- a/tests/Unit/Services/Users/UpdateServiceTest.php +++ b/tests/Unit/Services/Users/UpdateServiceTest.php @@ -24,11 +24,11 @@ namespace Tests\Unit\Services\Users; -use Illuminate\Contracts\Hashing\Hasher; -use Pterodactyl\Contracts\Repository\UserRepositoryInterface; -use Pterodactyl\Services\Users\UpdateService; -use Tests\TestCase; use Mockery as m; +use Tests\TestCase; +use Illuminate\Contracts\Hashing\Hasher; +use Pterodactyl\Services\Users\UpdateService; +use Pterodactyl\Contracts\Repository\UserRepositoryInterface; class UpdateServiceTest extends TestCase {