diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index ef8fb8bbc..a46e8f32a 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -489,7 +489,7 @@ App::get('/v1/functions/:functionId/tags/:tagId') $tag = $projectDB->getDocument($tagId); - if($tag->getAttribute('functionId') !== $function->getId()) { + if ($tag->getAttribute('functionId') !== $function->getId()) { throw new Exception('Tag not found', 404); } @@ -519,7 +519,7 @@ App::delete('/v1/functions/:functionId/tags/:tagId') $tag = $projectDB->getDocument($tagId); - if($tag->getAttribute('functionId') !== $function->getId()) { + if ($tag->getAttribute('functionId') !== $function->getId()) { throw new Exception('Tag not found', 404); } @@ -575,7 +575,7 @@ App::post('/v1/functions/:functionId/executions') $tag = $projectDB->getDocument($function->getAttribute('tag')); - if($tag->getAttribute('functionId') !== $function->getId()) { + if ($tag->getAttribute('functionId') !== $function->getId()) { throw new Exception('Tag not found. Deploy tag before trying to execute a function', 404); } @@ -673,7 +673,7 @@ App::get('/v1/functions/:functionId/executions/:executionId') $execution = $projectDB->getDocument($executionId); - if($execution->getAttribute('functionId') !== $function->getId()) { + if ($execution->getAttribute('functionId') !== $function->getId()) { throw new Exception('Execution not found', 404); } diff --git a/app/controllers/general.php b/app/controllers/general.php index 5c828cb1e..a6bc00486 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -47,7 +47,7 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo $route = $utopia->match($request); - if(!empty($route->getLabel('sdk.platform', [])) && empty($project->getId()) && ($route->getLabel('scope', '') !== 'public')) { + if (!empty($route->getLabel('sdk.platform', [])) && empty($project->getId()) && ($route->getLabel('scope', '') !== 'public')) { throw new Exception('Missing or unknown project ID', 400); } @@ -102,8 +102,8 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo * @see https://www.owasp.org/index.php/List_of_useful_HTTP_headers */ if (App::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS - if($request->getProtocol() !== 'https') { - return $response->redirect('https://'.$request->getHostname().$request->getURI()); + if ($request->getProtocol() !== 'https') { + return $response->redirect('https://'.$request->getHostname().$request->getURI()); } $response->addHeader('Strict-Transport-Security', 'max-age='.(60 * 60 * 24 * 126)); // 126 days @@ -129,11 +129,11 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo $origin = $request->getOrigin($request->getReferer('')); $originValidator = new Origin(\array_merge($project->getAttribute('platforms', []), $console->getAttribute('platforms', []))); - if(!$originValidator->isValid($origin) + if (!$originValidator->isValid($origin) && \in_array($request->getMethod(), [Request::METHOD_POST, Request::METHOD_PUT, Request::METHOD_PATCH, Request::METHOD_DELETE]) && $route->getLabel('origin', false) !== '*' && empty($request->getHeader('x-appwrite-key', ''))) { - throw new Exception($originValidator->getDescription(), 403); + throw new Exception($originValidator->getDescription(), 403); } /* @@ -186,7 +186,7 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo Authorization::setDefaultStatus(false); // Cancel security segmentation for API keys. } - if($user->getId()) { + if ($user->getId()) { Authorization::setRole('user:'.$user->getId()); } @@ -301,7 +301,7 @@ App::shutdown(function ($utopia, $request, $response, $project, $webhooks, $audi $route = $utopia->match($request); - if($project->getId() + if ($project->getId() && $mode !== APP_MODE_ADMIN && !empty($route->getLabel('sdk.namespace', null))) { // Don't calculate console usage and admin mode @@ -340,7 +340,7 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project) { $route = $utopia->match($request); $template = ($route) ? $route->getLabel('error', null) : null; - if(php_sapi_name() === 'cli') { + if (php_sapi_name() === 'cli') { Console::error('[Error] Method: '.$route->getMethod()); Console::error('[Error] URL: '.$route->getURL()); Console::error('[Error] Type: '.get_class($error)); @@ -413,7 +413,6 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project) { $response->dynamic(new Document($output), $utopia->isDevelopment() ? Response::MODEL_ERROR_DEV : Response::MODEL_LOCALE); - }, ['error', 'utopia', 'request', 'response', 'layout', 'project']); App::get('/manifest.json') @@ -469,25 +468,25 @@ App::get('/.well-known/acme-challenge') $path = \str_replace('/.well-known/acme-challenge/', '', $request->getParam('q')); $absolute = \realpath($base.'/.well-known/acme-challenge/'.$path); - if(!$base) { + if (!$base) { throw new Exception('Storage error', 500); } - if(!$absolute) { + if (!$absolute) { throw new Exception('Unknown path', 404); } - if(!\substr($absolute, 0, \strlen($base)) === $base) { + if (!\substr($absolute, 0, \strlen($base)) === $base) { throw new Exception('Invalid path', 401); } - if(!\file_exists($absolute)) { + if (!\file_exists($absolute)) { throw new Exception('Unknown path', 404); } $content = @\file_get_contents($absolute); - if(!$content) { + if (!$content) { throw new Exception('Failed to get contents', 500); } @@ -497,6 +496,6 @@ App::get('/.well-known/acme-challenge') include_once __DIR__ . '/shared/api.php'; include_once __DIR__ . '/shared/web.php'; -foreach(Config::getParam('services', []) as $service) { +foreach (Config::getParam('services', []) as $service) { include_once $service['controller']; } \ No newline at end of file diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index 47e1848a6..a9b50b05b 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -385,10 +385,9 @@ App::get('/console/version') try { $version = \json_decode(@\file_get_contents(App::getEnv('_APP_HOME', 'http://localhost').'/v1/health/version'), true); - if($version && isset($version['version'])) { + if ($version && isset($version['version'])) { return $response->json(['version' => $version['version']]); - } - else { + } else { throw new Exception('Failed to check for a newer version', 500); } } catch (\Throwable $th) { diff --git a/src/Appwrite/Auth/OAuth2/Box.php b/src/Appwrite/Auth/OAuth2/Box.php index 48e2a387a..7fbcf5954 100644 --- a/src/Appwrite/Auth/OAuth2/Box.php +++ b/src/Appwrite/Auth/OAuth2/Box.php @@ -9,9 +9,14 @@ use Appwrite\Auth\OAuth2; class Box extends OAuth2 { - + /** + * @var string + */ private $endpoint = 'https://account.box.com/api/oauth2/'; + /** + * @var string + */ private $resourceEndpoint = 'https://api.box.com/2.0/'; /** @@ -19,6 +24,9 @@ class Box extends OAuth2 */ protected $user = []; + /** + * @var array + */ protected $scopes = [ 'manage_app_users', ]; @@ -148,5 +156,4 @@ class Box extends OAuth2 return $this->user; } - } \ No newline at end of file diff --git a/src/Appwrite/Auth/OAuth2/Github.php b/src/Appwrite/Auth/OAuth2/Github.php index 3ab8e51a8..0f86b8910 100644 --- a/src/Appwrite/Auth/OAuth2/Github.php +++ b/src/Appwrite/Auth/OAuth2/Github.php @@ -125,7 +125,7 @@ class Github extends OAuth2 * @return array */ protected function getUser(string $accessToken) - { + { if (empty($this->user)) { $this->user = \json_decode($this->request('GET', 'https://api.github.com/user', ['Authorization: token '.\urlencode($accessToken)]), true); } diff --git a/src/Appwrite/Database/Adapter/MySQL.php b/src/Appwrite/Database/Adapter/MySQL.php index 313a9075f..456a411ce 100644 --- a/src/Appwrite/Database/Adapter/MySQL.php +++ b/src/Appwrite/Database/Adapter/MySQL.php @@ -232,7 +232,7 @@ class MySQL extends Adapter // Handle array of relations if (self::DATA_TYPE_ARRAY === $type) { - if(!is_array($value)) { // Property should be of type array, if not = skip + if (!is_array($value)) { // Property should be of type array, if not = skip continue; } diff --git a/src/Appwrite/Database/Database.php b/src/Appwrite/Database/Database.php index 51b46d265..e28a57029 100644 --- a/src/Appwrite/Database/Database.php +++ b/src/Appwrite/Database/Database.php @@ -458,7 +458,7 @@ class Database $filters = $rule->getAttribute('filter', null); $value = $document->getAttribute($key, null); - if(($value !== null) && is_array($filters)) { + if (($value !== null) && is_array($filters)) { foreach ($filters as $filter) { $value = $this->encodeAttribute($filter, $value); $document->setAttribute($key, $value); @@ -479,7 +479,7 @@ class Database $filters = $rule->getAttribute('filter', null); $value = $document->getAttribute($key, null); - if(($value !== null) && is_array($filters)) { + if (($value !== null) && is_array($filters)) { foreach (array_reverse($filters) as $filter) { $value = $this->decodeAttribute($filter, $value); $document->setAttribute($key, $value); @@ -498,7 +498,7 @@ class Database */ static protected function encodeAttribute(string $name, $value) { - if(!isset(self::$filters[$name])) { + if (!isset(self::$filters[$name])) { throw new Exception('Filter not found'); } @@ -519,7 +519,7 @@ class Database */ static protected function decodeAttribute(string $name, $value) { - if(!isset(self::$filters[$name])) { + if (!isset(self::$filters[$name])) { throw new Exception('Filter not found'); } diff --git a/src/Appwrite/Database/Document.php b/src/Appwrite/Database/Document.php index 2a472b839..aa90fba10 100644 --- a/src/Appwrite/Database/Document.php +++ b/src/Appwrite/Database/Document.php @@ -219,7 +219,7 @@ class Document extends ArrayObject { $array = parent::getArrayCopy(); - $output = array(); + $output = []; foreach ($array as $key => &$value) { if (!empty($whitelist) && !\in_array($key, $whitelist)) { // Export only whitelisted fields diff --git a/src/Appwrite/Database/Validator/Structure.php b/src/Appwrite/Database/Validator/Structure.php index 34d885039..5aea6c1b3 100644 --- a/src/Appwrite/Database/Validator/Structure.php +++ b/src/Appwrite/Database/Validator/Structure.php @@ -157,7 +157,7 @@ class Structure extends Validator foreach ($array as $key => $value) { $rule = $collection->search('key', $key, $rules); - if(!$rule) { + if (!$rule) { continue; } diff --git a/src/Appwrite/Database/Validator/UID.php b/src/Appwrite/Database/Validator/UID.php index a68c3da35..4cc3f1d5b 100644 --- a/src/Appwrite/Database/Validator/UID.php +++ b/src/Appwrite/Database/Validator/UID.php @@ -37,7 +37,7 @@ class UID extends Validator return false; } - if(mb_strlen($value) > 32) { + if (mb_strlen($value) > 32) { return false; } diff --git a/src/Appwrite/Docker/Compose.php b/src/Appwrite/Docker/Compose.php index e9fb90687..e5c6a8171 100644 --- a/src/Appwrite/Docker/Compose.php +++ b/src/Appwrite/Docker/Compose.php @@ -48,7 +48,7 @@ class Compose */ public function getService(string $name): Service { - if(!isset($this->compose['services'][$name])) { + if (!isset($this->compose['services'][$name])) { throw new Exception('Service not found'); } diff --git a/src/Appwrite/Docker/Env.php b/src/Appwrite/Docker/Env.php index f97f68b00..3076eb643 100644 --- a/src/Appwrite/Docker/Env.php +++ b/src/Appwrite/Docker/Env.php @@ -16,15 +16,14 @@ class Env */ public function __construct(string $data) { - $data = explode("\n", $data); - foreach($data as &$row) { + foreach ($data as &$row) { $row = explode('=', $row); $key = (isset($row[0])) ? trim($row[0]) : null; $value = (isset($row[1])) ? trim($row[1]) : null; - if($key) { + if ($key) { $this->vars[$key] = $value; } } diff --git a/src/Appwrite/Extend/PDOStatement.php b/src/Appwrite/Extend/PDOStatement.php index a752f9f27..412607d9e 100644 --- a/src/Appwrite/Extend/PDOStatement.php +++ b/src/Appwrite/Extend/PDOStatement.php @@ -73,15 +73,15 @@ class PDOStatement extends PDOStatementNative $this->pdo = $this->pdo->reconnect(); $this->PDOStatement = $this->pdo->prepare($this->PDOStatement->queryString, []); - foreach($this->values as $key => $set) { + foreach ($this->values as $key => $set) { $this->PDOStatement->bindValue($key, $set['value'], $set['data_type']); } - foreach($this->params as $key => $set) { + foreach ($this->params as $key => $set) { $this->PDOStatement->bindParam($key, $set['variable'], $set['data_type'], $set['length'], $set['driver_options']); } - foreach($this->columns as $key => $set) { + foreach ($this->columns as $key => $set) { $this->PDOStatement->bindColumn($key, $set['param'], $set['type'], $set['maxlen'], $set['driverdata']); } diff --git a/src/Appwrite/Network/Validator/CNAME.php b/src/Appwrite/Network/Validator/CNAME.php index 1d299e48c..c2adfdddd 100644 --- a/src/Appwrite/Network/Validator/CNAME.php +++ b/src/Appwrite/Network/Validator/CNAME.php @@ -36,7 +36,7 @@ class CNAME extends Validator */ public function isValid($domain) { - if(!is_string($domain)) { + if (!is_string($domain)) { return false; } diff --git a/src/Appwrite/Network/Validator/Domain.php b/src/Appwrite/Network/Validator/Domain.php index 848e338d6..0d5def06c 100644 --- a/src/Appwrite/Network/Validator/Domain.php +++ b/src/Appwrite/Network/Validator/Domain.php @@ -37,11 +37,11 @@ class Domain extends Validator */ public function isValid($value) { - if(empty($value)) { + if (empty($value)) { return false; } - if(!is_string($value)) { + if (!is_string($value)) { return false; } diff --git a/src/Appwrite/Network/Validator/Origin.php b/src/Appwrite/Network/Validator/Origin.php index 62f1608af..c0afb1f56 100644 --- a/src/Appwrite/Network/Validator/Origin.php +++ b/src/Appwrite/Network/Validator/Origin.php @@ -99,7 +99,7 @@ class Origin extends Validator */ public function isValid($origin) { - if(!is_string($origin)) { + if (!is_string($origin)) { return false; } diff --git a/src/Appwrite/Storage/Storage.php b/src/Appwrite/Storage/Storage.php index fc98f19fd..d10c6b38a 100644 --- a/src/Appwrite/Storage/Storage.php +++ b/src/Appwrite/Storage/Storage.php @@ -13,7 +13,7 @@ class Storage * * @var array */ - public static $devices = array(); + public static $devices = []; /** * Set Device. diff --git a/src/Appwrite/Storage/Validator/FileName.php b/src/Appwrite/Storage/Validator/FileName.php index a7d2e43a7..acb76fdab 100644 --- a/src/Appwrite/Storage/Validator/FileName.php +++ b/src/Appwrite/Storage/Validator/FileName.php @@ -24,7 +24,7 @@ class FileName extends Validator return false; } - if(!is_string($name)) { + if (!is_string($name)) { return false; } diff --git a/src/Appwrite/Storage/Validator/FileSize.php b/src/Appwrite/Storage/Validator/FileSize.php index ab5d36144..1bbf74918 100644 --- a/src/Appwrite/Storage/Validator/FileSize.php +++ b/src/Appwrite/Storage/Validator/FileSize.php @@ -35,7 +35,7 @@ class FileSize extends Validator */ public function isValid($fileSize) { - if(!is_int($fileSize)) { + if (!is_int($fileSize)) { return false; } diff --git a/src/Appwrite/Storage/Validator/Upload.php b/src/Appwrite/Storage/Validator/Upload.php index 023946442..38296e8d0 100644 --- a/src/Appwrite/Storage/Validator/Upload.php +++ b/src/Appwrite/Storage/Validator/Upload.php @@ -20,7 +20,7 @@ class Upload extends Validator */ public function isValid($path) { - if(!is_string($path)) { + if (!is_string($path)) { return false; } diff --git a/src/Appwrite/Task/Validator/Cron.php b/src/Appwrite/Task/Validator/Cron.php index 68c7c4b0f..18f427ee7 100644 --- a/src/Appwrite/Task/Validator/Cron.php +++ b/src/Appwrite/Task/Validator/Cron.php @@ -30,7 +30,7 @@ class Cron extends Validator */ public function isValid($value) { - if(empty($value)) { + if (empty($value)) { return true; } diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 66d1eaf18..22f2925e5 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -205,7 +205,7 @@ class Response extends SwooleResponse */ public function getModel(string $key): Model { - if(!isset($this->models[$key])) { + if (!isset($this->models[$key])) { throw new Exception('Undefined model: '.$key); } @@ -230,28 +230,27 @@ class Response extends SwooleResponse $model = $this->getModel($model); $output = []; - if($model->isAny()) { + if ($model->isAny()) { return $document->getArrayCopy(); } - foreach($model->getRules() as $key => $rule) { - if(!$document->isSet($key)) { - if(!is_null($rule['default'])) { + foreach ($model->getRules() as $key => $rule) { + if (!$document->isSet($key)) { + if (!is_null($rule['default'])) { $document->setAttribute($key, $rule['default']); - } - else { + } else { throw new Exception('Model '.$model->getName().' is missing response key: '.$key); } } - if($rule['array']) { - if(!is_array($data[$key])) { + if ($rule['array']) { + if (!is_array($data[$key])) { throw new Exception($key.' must be an array of type '.$rule['type']); } foreach ($data[$key] as &$item) { - if($item instanceof Document) { - if(!array_key_exists($rule['type'], $this->models)) { + if ($item instanceof Document) { + if (!array_key_exists($rule['type'], $this->models)) { throw new Exception('Missing model for rule: '. $rule['type']); } @@ -282,7 +281,7 @@ class Response extends SwooleResponse */ public function yaml(array $data): void { - if(!extension_loaded('yaml')) { + if (!extension_loaded('yaml')) { throw new Exception('Missing yaml extension. Learn more at: https://www.php.net/manual/en/book.yaml.php'); } diff --git a/src/Appwrite/Utopia/Response/Model/BaseList.php b/src/Appwrite/Utopia/Response/Model/BaseList.php index 2f30b1838..21dd6eb92 100644 --- a/src/Appwrite/Utopia/Response/Model/BaseList.php +++ b/src/Appwrite/Utopia/Response/Model/BaseList.php @@ -22,7 +22,7 @@ class BaseList extends Model $this->name = $name; $this->type = $type; - if($paging) { + if ($paging) { $this->addRule('sum', [ 'type' => 'integer', 'description' => 'Total sum of items in the list.', diff --git a/tests/e2e/Client.php b/tests/e2e/Client.php index e2a805a2b..2d8eff951 100644 --- a/tests/e2e/Client.php +++ b/tests/e2e/Client.php @@ -218,7 +218,7 @@ class Client case 'application/json': $json = json_decode($responseBody, true); - if($json === null) { + if ($json === null) { throw new Exception('Failed to parse response: '.$responseBody); } @@ -235,7 +235,7 @@ class Client $responseHeaders['status-code'] = $responseStatus; - if($responseStatus === 500) { + if ($responseStatus === 500) { echo 'Server error('.$method.': '.$path.'. Params: '.json_encode($params).'): '.json_encode($responseBody)."\n"; } diff --git a/tests/e2e/Scopes/ProjectCustom.php b/tests/e2e/Scopes/ProjectCustom.php index d4d787784..831a0fbb7 100644 --- a/tests/e2e/Scopes/ProjectCustom.php +++ b/tests/e2e/Scopes/ProjectCustom.php @@ -16,7 +16,7 @@ trait ProjectCustom */ public function getProject(): array { - if(!empty(self::$project)) { + if (!empty(self::$project)) { return self::$project; } diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index 07e9ec67e..36832b5d2 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -37,7 +37,7 @@ abstract class Scope extends TestCase $emails = json_decode(file_get_contents('http://maildev/email'), true); - if($emails && is_array($emails)) { + if ($emails && is_array($emails)) { return end($emails); } @@ -74,7 +74,7 @@ abstract class Scope extends TestCase */ public function getRoot(): array { - if((self::$root)) { + if ((self::$root)) { return self::$root; } @@ -125,7 +125,7 @@ abstract class Scope extends TestCase */ public function getUser(): array { - if(isset(self::$user[$this->getProject()['$id']])) { + if (isset(self::$user[$this->getProject()['$id']])) { return self::$user[$this->getProject()['$id']]; } diff --git a/tests/e2e/Services/Health/HealthBase.php b/tests/e2e/Services/Health/HealthBase.php index ff9aab9f8..b7d4ce477 100644 --- a/tests/e2e/Services/Health/HealthBase.php +++ b/tests/e2e/Services/Health/HealthBase.php @@ -6,5 +6,4 @@ use Tests\E2E\Client; trait HealthBase { - } \ No newline at end of file diff --git a/tests/e2e/Services/Projects/ProjectsBase.php b/tests/e2e/Services/Projects/ProjectsBase.php index dd802a540..ef67968b9 100644 --- a/tests/e2e/Services/Projects/ProjectsBase.php +++ b/tests/e2e/Services/Projects/ProjectsBase.php @@ -6,5 +6,4 @@ use Tests\E2E\Client; trait ProjectsBase { - } \ No newline at end of file diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 5c7692f7c..fb571d365 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -139,7 +139,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); - return $data; + return $data; } /** @@ -198,7 +198,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); - return $data; + return $data; } /** @@ -256,7 +256,7 @@ class ProjectsConsoleClientTest extends Scope * Test for SUCCESS */ - foreach($providers as $key => $provider) { + foreach ($providers as $key => $provider) { $response = $this->client->call(Client::METHOD_PATCH, '/projects/'.$id.'/oauth2', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -279,7 +279,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertNotEmpty($response['body']); $this->assertEquals($id, $response['body']['$id']); - foreach($providers as $key => $provider) { + foreach ($providers as $key => $provider) { $this->assertEquals('AppId-'.ucfirst($key), $response['body']['usersOauth2'.ucfirst($key).'Appid']); $this->assertEquals('Secret-'.ucfirst($key), $response['body']['usersOauth2'.ucfirst($key).'Secret']); } diff --git a/tests/e2e/Services/Teams/TeamsBase.php b/tests/e2e/Services/Teams/TeamsBase.php index a8ac2ac43..cdcb48b22 100644 --- a/tests/e2e/Services/Teams/TeamsBase.php +++ b/tests/e2e/Services/Teams/TeamsBase.php @@ -96,7 +96,7 @@ trait TeamsBase * Test for FAILURE */ - return []; + return []; } /** @@ -171,7 +171,7 @@ trait TeamsBase * Test for FAILURE */ - return []; + return []; } public function testUpdateTeam():array diff --git a/tests/e2e/Services/Teams/TeamsBaseClient.php b/tests/e2e/Services/Teams/TeamsBaseClient.php index 25bbcbdd5..72fc99d88 100644 --- a/tests/e2e/Services/Teams/TeamsBaseClient.php +++ b/tests/e2e/Services/Teams/TeamsBaseClient.php @@ -32,7 +32,7 @@ trait TeamsBaseClient * Test for FAILURE */ - return $data; + return $data; } /** diff --git a/tests/e2e/Services/Teams/TeamsBaseServer.php b/tests/e2e/Services/Teams/TeamsBaseServer.php index 9869ce590..846c321b1 100644 --- a/tests/e2e/Services/Teams/TeamsBaseServer.php +++ b/tests/e2e/Services/Teams/TeamsBaseServer.php @@ -28,7 +28,7 @@ trait TeamsBaseServer * Test for FAILURE */ - return []; + return []; } diff --git a/tests/unit/Docker/ComposeTest.php b/tests/unit/Docker/ComposeTest.php index 210fee96d..c484fc17e 100644 --- a/tests/unit/Docker/ComposeTest.php +++ b/tests/unit/Docker/ComposeTest.php @@ -18,7 +18,7 @@ class ComposeTest extends TestCase { $data = @file_get_contents(__DIR__.'/../../resources/docker/docker-compose.yml'); - if($data === false) { + if ($data === false) { throw new Exception('Failed to read compose file'); } diff --git a/tests/unit/Docker/EnvTest.php b/tests/unit/Docker/EnvTest.php index 6e706a43f..2fb3e6d55 100644 --- a/tests/unit/Docker/EnvTest.php +++ b/tests/unit/Docker/EnvTest.php @@ -18,7 +18,7 @@ class EnvTest extends TestCase { $data = @file_get_contents(__DIR__.'/../../resources/docker/.env'); - if($data === false) { + if ($data === false) { throw new Exception('Failed to read compose file'); } diff --git a/tests/unit/Network/Validators/OriginTest.php b/tests/unit/Network/Validators/OriginTest.php index 5b1cc2f44..4ba618f32 100644 --- a/tests/unit/Network/Validators/OriginTest.php +++ b/tests/unit/Network/Validators/OriginTest.php @@ -60,6 +60,5 @@ class OriginTest extends TestCase $this->assertEquals($validator->isValid('appwrite-windows://com.company.appname'), false); $this->assertEquals($validator->getDescription(), 'Invalid Origin. Register your new client (com.company.appname) as a new Windows platform on your project console dashboard'); - } } \ No newline at end of file diff --git a/tests/unit/Storage/StorageTest.php b/tests/unit/Storage/StorageTest.php index 7ffe9ce50..4d3196612 100644 --- a/tests/unit/Storage/StorageTest.php +++ b/tests/unit/Storage/StorageTest.php @@ -28,7 +28,7 @@ class StorageTest extends TestCase try { get_class(Storage::getDevice('disk-c')); $this->fail("Expected exception not thrown"); - } catch(Exception $e) { + } catch (Exception $e) { $this->assertEquals('The device "disk-c" is not listed', $e->getMessage()); } }