From d0a55e266c3b9c3ab3da602fa73712716dffd4ee Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Thu, 6 Jun 2024 20:54:51 -0400 Subject: [PATCH] lint: Linting --- app/cli.php | 8 +++---- app/controllers/api/avatars.php | 2 +- app/controllers/api/functions.php | 2 +- app/controllers/api/project.php | 3 ++- app/controllers/api/projects.php | 24 +++++++++---------- app/controllers/api/storage.php | 8 +++---- app/controllers/general.php | 18 +++++++------- app/http.php | 2 +- app/worker.php | 21 +--------------- src/Appwrite/Platform/Tasks/QueueCount.php | 2 +- src/Appwrite/Platform/Tasks/QueueRetry.php | 1 - src/Appwrite/Platform/Tasks/ScheduleBase.php | 5 +--- .../Platform/Tasks/ScheduleMessages.php | 1 - src/Appwrite/Platform/Workers/Deletes.php | 2 +- tests/unit/Utopia/RequestTest.php | 2 +- 15 files changed, 38 insertions(+), 63 deletions(-) diff --git a/app/cli.php b/app/cli.php index 8b4a7c8616..7dd16f5c2f 100644 --- a/app/cli.php +++ b/app/cli.php @@ -7,18 +7,16 @@ use Appwrite\Event\Certificate; use Appwrite\Event\Delete; use Appwrite\Event\Hamster; use Appwrite\Platform\Appwrite; +use Swoole\Runtime; +use Utopia\CLI\Adapters\Swoole as SwooleCLI; use Utopia\CLI\Console; use Utopia\Database\Validator\Authorization; use Utopia\DI\Dependency; -use Utopia\DSN\DSN; use Utopia\Logger\Log; use Utopia\Platform\Service; -use Utopia\Pools\Group; use Utopia\Queue\Connection; use Utopia\Registry\Registry; use Utopia\System\System; -use Swoole\Runtime; -use Utopia\CLI\Adapters\Swoole as SwooleCLI; global $global, $container; @@ -105,7 +103,7 @@ $logError $auth ->setName('auth') - ->setCallback(fn() => new Authorization()); + ->setCallback(fn () => new Authorization()); $container->set($auth); $container->set($logError); diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 6030e4b28a..b54413f457 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -13,6 +13,7 @@ use Utopia\Database\Document; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\UID; use Utopia\Domains\Domain; +use Utopia\Fetch\Client; use Utopia\Http\Http; use Utopia\Http\Validator\Boolean; use Utopia\Http\Validator\HexColor; @@ -20,7 +21,6 @@ use Utopia\Http\Validator\Range; use Utopia\Http\Validator\Text; use Utopia\Http\Validator\URL; use Utopia\Http\Validator\WhiteList; -use Utopia\Fetch\Client; use Utopia\Image\Image; use Utopia\Logger\Log; use Utopia\Logger\Logger; diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index ef9a77298f..b5e02b9dad 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1772,7 +1772,7 @@ Http::post('/v1/functions/:functionId/executions') if ($function->getAttribute('logging')) { /** @var Document $execution */ - $execution = $authorization->skip(fn () => $dbForProject->createDocument('executions', $execution)); + $execution = $authorization->skip(fn () => $dbForProject->createDocument('executions', $execution)); } } diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index aaa25df1b5..d24a33c6c1 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -71,7 +71,8 @@ Http::get('/v1/project/usage') '1d' => 'Y-m-d\T00:00:00.000P', }; - $authorization->skip(function () use ($dbForProject, $firstDay, $lastDay, $period, $metrics, $limit, &$total, &$stats) { foreach ($metrics['total'] as $metric) { + $authorization->skip(function () use ($dbForProject, $firstDay, $lastDay, $period, $metrics, $limit, &$total, &$stats) { + foreach ($metrics['total'] as $metric) { $result = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), Query::equal('period', ['inf']) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 6de5a87ea2..f23e40e581 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -11,8 +11,8 @@ use Appwrite\Network\Validator\Origin; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\ProjectId; use Appwrite\Utopia\Database\Validator\Queries\Projects; -use Appwrite\Utopia\Request; use Appwrite\Utopia\Queue\Connections; +use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use PHPMailer\PHPMailer\PHPMailer; use Utopia\Abuse\Adapters\TimeLimit; @@ -69,7 +69,7 @@ Http::post('/v1/projects') ->param('projectId', '', new ProjectId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can\'t start with a special char. Max length is 36 chars.') ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') ->param('teamId', '', new UID(), 'Team unique ID.') - ->param('region', System::getEnv('_APP_REGION', 'default'), new Whitelist(array_keys(array_filter(Config::getParam('regions'), fn($config) => !$config['disabled']))), 'Project Region.', true) + ->param('region', System::getEnv('_APP_REGION', 'default'), new Whitelist(array_keys(array_filter(Config::getParam('regions'), fn ($config) => !$config['disabled']))), 'Project Region.', true) ->param('description', '', new Text(256), 'Project description. Max length: 256 chars.', true) ->param('logo', '', new Text(1024), 'Project logo.', true) ->param('url', '', new URL(), 'Project URL.', true) @@ -504,7 +504,7 @@ Http::patch('/v1/projects/:projectId/service') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_PROJECT) ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('service', '', new WhiteList(array_keys(array_filter(Config::getParam('services'), fn($element) => $element['optional'])), true), 'Service name.') + ->param('service', '', new WhiteList(array_keys(array_filter(Config::getParam('services'), fn ($element) => $element['optional'])), true), 'Service name.') ->param('status', null, new Boolean(), 'Service status.') ->inject('response') ->inject('dbForConsole') @@ -544,7 +544,7 @@ Http::patch('/v1/projects/:projectId/service/all') throw new Exception(Exception::PROJECT_NOT_FOUND); } - $allServices = array_keys(array_filter(Config::getParam('services'), fn($element) => $element['optional'])); + $allServices = array_keys(array_filter(Config::getParam('services'), fn ($element) => $element['optional'])); $services = []; foreach ($allServices as $service) { @@ -947,7 +947,7 @@ Http::post('/v1/projects/:projectId/webhooks') ->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.') ->param('enabled', true, new Boolean(true), 'Enable or disable a webhook.', true) ->param('events', null, new ArrayList(new Event(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.') - ->param('url', '', fn($request) => new Multiple([new URL(['http', 'https']), new PublicDomain()], Multiple::TYPE_STRING), 'Webhook URL.', false, ['request']) + ->param('url', '', fn ($request) => new Multiple([new URL(['http', 'https']), new PublicDomain()], Multiple::TYPE_STRING), 'Webhook URL.', false, ['request']) ->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.') ->param('httpUser', '', new Text(256), 'Webhook HTTP user. Max length: 256 chars.', true) ->param('httpPass', '', new Text(256), 'Webhook HTTP password. Max length: 256 chars.', true) @@ -1069,7 +1069,7 @@ Http::put('/v1/projects/:projectId/webhooks/:webhookId') ->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.') ->param('enabled', true, new Boolean(true), 'Enable or disable a webhook.', true) ->param('events', null, new ArrayList(new Event(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.') - ->param('url', '', fn($request) => new Multiple([new URL(['http', 'https']), new PublicDomain()], Multiple::TYPE_STRING), 'Webhook URL.', false, ['request']) + ->param('url', '', fn ($request) => new Multiple([new URL(['http', 'https']), new PublicDomain()], Multiple::TYPE_STRING), 'Webhook URL.', false, ['request']) ->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.') ->param('httpUser', '', new Text(256), 'Webhook HTTP user. Max length: 256 chars.', true) ->param('httpPass', '', new Text(256), 'Webhook HTTP password. Max length: 256 chars.', true) @@ -1743,7 +1743,7 @@ Http::get('/v1/projects/:projectId/templates/sms/:type/:locale') ->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') - ->param('locale', '', fn($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) + ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->inject('response') ->inject('dbForConsole') ->action(function (string $projectId, string $type, string $locale, Response $response, Database $dbForConsole) { @@ -1783,7 +1783,7 @@ Http::get('/v1/projects/:projectId/templates/email/:type/:locale') ->label('sdk.response.model', Response::MODEL_EMAIL_TEMPLATE) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') - ->param('locale', '', fn($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) + ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->inject('response') ->inject('dbForConsole') ->action(function (string $projectId, string $type, string $locale, Response $response, Database $dbForConsole) { @@ -1834,7 +1834,7 @@ Http::patch('/v1/projects/:projectId/templates/sms/:type/:locale') ->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') - ->param('locale', '', fn($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) + ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->param('message', '', new Text(0), 'Template message') ->inject('response') ->inject('dbForConsole') @@ -1873,7 +1873,7 @@ Http::patch('/v1/projects/:projectId/templates/email/:type/:locale') ->label('sdk.response.model', Response::MODEL_PROJECT) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') - ->param('locale', '', fn($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) + ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->param('subject', '', new Text(255), 'Email Subject') ->param('message', '', new Text(0), 'Template message') ->param('senderName', '', new Text(255, 0), 'Name of the email sender', true) @@ -1922,7 +1922,7 @@ Http::delete('/v1/projects/:projectId/templates/sms/:type/:locale') ->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') - ->param('locale', '', fn($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) + ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->inject('response') ->inject('dbForConsole') ->action(function (string $projectId, string $type, string $locale, Response $response, Database $dbForConsole) { @@ -1964,7 +1964,7 @@ Http::delete('/v1/projects/:projectId/templates/email/:type/:locale') ->label('sdk.response.model', Response::MODEL_EMAIL_TEMPLATE) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') - ->param('locale', '', fn($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) + ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->inject('response') ->inject('dbForConsole') ->action(function (string $projectId, string $type, string $locale, Response $response, Database $dbForConsole) { diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index aa2001712f..bfd98dd636 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -631,10 +631,10 @@ Http::post('/v1/storage/buckets/:bucketId/files') * However as with chunk upload even if we are updating, we are essentially creating a file * adding it's new chunk so we validate create permission instead of update */ - if (!$authorization->isValid(new Input(Database::PERMISSION_CREATE, $bucket->getCreate()))) { + if (!$authorization->isValid(new Input(Database::PERMISSION_CREATE, $bucket->getCreate()))) { throw new Exception(Exception::USER_UNAUTHORIZED); } - $file = $authorization->skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); + $file = $authorization->skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); } } else { if ($file->isEmpty()) { @@ -669,10 +669,10 @@ Http::post('/v1/storage/buckets/:bucketId/files') * However as with chunk upload even if we are updating, we are essentially creating a file * adding it's new chunk so we validate create permission instead of update */ - if (!$authorization->isValid(new Input(Database::PERMISSION_CREATE, $bucket->getCreate()))) { + if (!$authorization->isValid(new Input(Database::PERMISSION_CREATE, $bucket->getCreate()))) { throw new Exception(Exception::USER_UNAUTHORIZED); } - $file = $authorization->skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); + $file = $authorization->skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); } } diff --git a/app/controllers/general.php b/app/controllers/general.php index d45d24e696..c31ee413f6 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -45,7 +45,7 @@ function router(Database $dbForConsole, callable $getProjectDB, Request $request $host = $request->getHostname() ?? ''; $rule = $auth->skip( - fn() => $dbForConsole->find('rules', [ + fn () => $dbForConsole->find('rules', [ Query::equal('domain', [$host]), Query::limit(1) ]) @@ -73,7 +73,7 @@ function router(Database $dbForConsole, callable $getProjectDB, Request $request $projectId = $rule->getAttribute('projectId'); $project = $auth->skip( - fn() => $dbForConsole->getDocument('projects', $projectId) + fn () => $dbForConsole->getDocument('projects', $projectId) ); if (array_key_exists('proxy', $project->getAttribute('services', []))) { $status = $project->getAttribute('services', [])['proxy']; @@ -115,11 +115,11 @@ function router(Database $dbForConsole, callable $getProjectDB, Request $request $requestHeaders = $request->getHeaders(); - $project = $auth->skip(fn() => $dbForConsole->getDocument('projects', $projectId)); + $project = $auth->skip(fn () => $dbForConsole->getDocument('projects', $projectId)); $dbForProject = $getProjectDB($project); - $function = $auth->skip(fn() => $dbForProject->getDocument('functions', $functionId)); + $function = $auth->skip(fn () => $dbForProject->getDocument('functions', $functionId)); if ($function->isEmpty() || !$function->getAttribute('enabled')) { throw new AppwriteException(AppwriteException::FUNCTION_NOT_FOUND); @@ -134,7 +134,7 @@ function router(Database $dbForConsole, callable $getProjectDB, Request $request throw new AppwriteException(AppwriteException::FUNCTION_RUNTIME_UNSUPPORTED, 'Runtime "' . $function->getAttribute('runtime', '') . '" is not supported'); } - $deployment = $auth->skip(fn() => $dbForProject->getDocument('deployments', $function->getAttribute('deployment', ''))); + $deployment = $auth->skip(fn () => $dbForProject->getDocument('deployments', $function->getAttribute('deployment', ''))); if ($deployment->getAttribute('resourceId') !== $function->getId()) { throw new AppwriteException(AppwriteException::DEPLOYMENT_NOT_FOUND, 'Deployment not found. Create a deployment before trying to execute a function'); @@ -145,7 +145,7 @@ function router(Database $dbForConsole, callable $getProjectDB, Request $request } /** Check if build has completed */ - $build = $auth->skip(fn() => $dbForProject->getDocument('builds', $deployment->getAttribute('buildId', ''))); + $build = $auth->skip(fn () => $dbForProject->getDocument('builds', $deployment->getAttribute('buildId', ''))); if ($build->isEmpty()) { throw new AppwriteException(AppwriteException::BUILD_NOT_FOUND); } @@ -310,7 +310,7 @@ function router(Database $dbForConsole, callable $getProjectDB, Request $request if ($function->getAttribute('logging')) { /** @var Document $execution */ - $execution = $auth->skip(fn() => $dbForProject->createDocument('executions', $execution)); + $execution = $auth->skip(fn () => $dbForProject->createDocument('executions', $execution)); } } @@ -550,10 +550,10 @@ Http::init() $isLocalHost || $isIpAddress ? null : ( - $isConsoleProject && $isConsoleRootSession + $isConsoleProject && $isConsoleRootSession ? '.' . $selfDomain->getRegisterable() : '.' . $request->getHostname() - ) + ) ); /* diff --git a/app/http.php b/app/http.php index 98996691e8..fdee2e4d4e 100644 --- a/app/http.php +++ b/app/http.php @@ -34,7 +34,7 @@ $server = new Server('0.0.0.0', '80', [ 'http_compression_level' => 6, 'package_max_length' => $payloadSize, 'buffer_output_size' => $payloadSize, - 'buffer_output_size' => $payloadSize, + 'buffer_output_size' => $payloadSize, // Server // 'log_level' => 0, diff --git a/app/worker.php b/app/worker.php index 7a62931a49..39cb69fd6f 100644 --- a/app/worker.php +++ b/app/worker.php @@ -2,41 +2,22 @@ require_once __DIR__ . '/init2.php'; -use Appwrite\Event\Audit; -use Appwrite\Event\Build; -use Appwrite\Event\Certificate; -use Appwrite\Event\Database as EventDatabase; -use Appwrite\Event\Delete; -use Appwrite\Event\Event; -use Appwrite\Event\Func; -use Appwrite\Event\Mail; -use Appwrite\Event\Messaging; -use Appwrite\Event\Migration; -use Appwrite\Event\Usage; use Appwrite\Event\UsageDump; use Appwrite\Platform\Appwrite; use Appwrite\Utopia\Queue\Connections; use Swoole\Runtime; -use Utopia\Cache\Adapter\None; -use Utopia\Cache\Adapter\Sharding; -use Utopia\Cache\Cache; use Utopia\CLI\Console; -use Utopia\Database\Adapter\MariaDB; -use Utopia\Database\Adapter\MySQL; use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Validator\Authorization; -use Utopia\DSN\DSN; use Utopia\DI\Dependency; use Utopia\Logger\Log; use Utopia\Logger\Logger; use Utopia\Platform\Service; use Utopia\Queue\Connection; -use Utopia\Queue\Connection\Redis; use Utopia\Queue\Message; use Utopia\Queue\Worker; -use Utopia\Registry\Registry; use Utopia\Storage\Device\Local; use Utopia\System\System; @@ -56,7 +37,7 @@ $deviceForLocalFiles = new Dependency(); $register ->setName('register') - ->setCallback(fn() => $global); + ->setCallback(fn () => $global); $project ->setName('project') diff --git a/src/Appwrite/Platform/Tasks/QueueCount.php b/src/Appwrite/Platform/Tasks/QueueCount.php index 01fc7160c1..63f829073a 100644 --- a/src/Appwrite/Platform/Tasks/QueueCount.php +++ b/src/Appwrite/Platform/Tasks/QueueCount.php @@ -3,8 +3,8 @@ namespace Appwrite\Platform\Tasks; use Utopia\CLI\Console; -use Utopia\Http\Validator\WhiteList; use Utopia\Http\Validator\Text; +use Utopia\Http\Validator\WhiteList; use Utopia\Platform\Action; use Utopia\Queue\Client; use Utopia\Queue\Connection; diff --git a/src/Appwrite/Platform/Tasks/QueueRetry.php b/src/Appwrite/Platform/Tasks/QueueRetry.php index 634147ec9c..63f6c8e11e 100644 --- a/src/Appwrite/Platform/Tasks/QueueRetry.php +++ b/src/Appwrite/Platform/Tasks/QueueRetry.php @@ -4,7 +4,6 @@ namespace Appwrite\Platform\Tasks; use Utopia\CLI\Console; use Utopia\Http\Validator\Text; -use Utopia\Http\Validator\WhiteList; use Utopia\Http\Validator\Wildcard; use Utopia\Platform\Action; use Utopia\Queue\Client; diff --git a/src/Appwrite/Platform/Tasks/ScheduleBase.php b/src/Appwrite/Platform/Tasks/ScheduleBase.php index 907d7d1a87..1877f878da 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleBase.php +++ b/src/Appwrite/Platform/Tasks/ScheduleBase.php @@ -11,11 +11,8 @@ use Utopia\Database\Document; use Utopia\Database\Exception; use Utopia\Database\Query; use Utopia\Platform\Action; -use Utopia\Pools\Group; use Utopia\System\System; -use function Swoole\Coroutine\run; - abstract class ScheduleBase extends Action { protected const UPDATE_TIMER = 10; //seconds @@ -188,7 +185,7 @@ abstract class ScheduleBase extends Action Timer::tick( static::ENQUEUE_TIMER * 1000, - fn() => $this->enqueueResources($pools, $dbForConsole) + fn () => $this->enqueueResources($pools, $dbForConsole) ); $this->enqueueResources($pools, $dbForConsole); diff --git a/src/Appwrite/Platform/Tasks/ScheduleMessages.php b/src/Appwrite/Platform/Tasks/ScheduleMessages.php index 3aad7d54cd..58e4218799 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleMessages.php +++ b/src/Appwrite/Platform/Tasks/ScheduleMessages.php @@ -4,7 +4,6 @@ namespace Appwrite\Platform\Tasks; use Appwrite\Event\Messaging; use Utopia\Database\Database; -use Utopia\Pools\Group; use Utopia\Queue\Connection\Redis; class ScheduleMessages extends ScheduleBase diff --git a/src/Appwrite/Platform/Workers/Deletes.php b/src/Appwrite/Platform/Workers/Deletes.php index 45df3e924f..2cb1a276b4 100644 --- a/src/Appwrite/Platform/Workers/Deletes.php +++ b/src/Appwrite/Platform/Workers/Deletes.php @@ -22,8 +22,8 @@ use Utopia\Database\Exception\Conflict; use Utopia\Database\Exception\Restricted; use Utopia\Database\Exception\Structure; use Utopia\Database\Query; -use Utopia\DSN\DSN; use Utopia\Database\Validator\Authorization as ValidatorAuthorization; +use Utopia\DSN\DSN; use Utopia\Logger\Log; use Utopia\Platform\Action; use Utopia\Queue\Message; diff --git a/tests/unit/Utopia/RequestTest.php b/tests/unit/Utopia/RequestTest.php index 0889c5ef6c..6124a7a0c1 100644 --- a/tests/unit/Utopia/RequestTest.php +++ b/tests/unit/Utopia/RequestTest.php @@ -5,9 +5,9 @@ namespace Tests\Unit\Utopia; use Appwrite\Utopia\Request; use PHPUnit\Framework\TestCase; use Swoole\Http\Request as SwooleRequest; -use Utopia\Http\Adapter\Swoole\Request as UtopiaSwooleRequest; use Tests\Unit\Utopia\Request\Filters\First; use Tests\Unit\Utopia\Request\Filters\Second; +use Utopia\Http\Adapter\Swoole\Request as UtopiaSwooleRequest; use Utopia\Http\Route; class RequestTest extends TestCase