From 52e2276445ea8728784b110797a852e4ec16408d Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 10 Mar 2026 15:49:03 +0530 Subject: [PATCH] Update dependencies and refactor code for clarity - Changed version constraint for `spomky-labs/otphp` in composer.json to allow any 11.x version. - Refactored `getDatabasesDBForProject` method in Migrations class to use the shorthand syntax for callable. - Updated return values in Format class to use more descriptive types for index creation. - Corrected parameter documentation in Attributes class for clarity and consistency. --- composer.json | 2 +- src/Appwrite/Platform/Workers/Migrations.php | 4 ++-- src/Appwrite/SDK/Specification/Format.php | 6 +++--- src/Appwrite/Utopia/Database/Validator/Attributes.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index c074abd0cb..c009c34e1b 100644 --- a/composer.json +++ b/composer.json @@ -87,7 +87,7 @@ "phpmailer/phpmailer": "6.9.*", "chillerlan/php-qrcode": "4.3.*", "adhocore/jwt": "1.1.*", - "spomky-labs/otphp": "^11.4.2", + "spomky-labs/otphp": "11.*", "webonyx/graphql-php": "14.11.*", "league/csv": "9.14.*", "enshrined/svg-sanitize": "0.22.*" diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index 50afb4c247..1938891588 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -544,9 +544,9 @@ class Migrations extends Action protected function getDatabasesDBForProject(Document $database) { if ($this->sourceProject) { - return call_user_func($this->getDatabasesDB, $database, $this->sourceProject); + return ($this->getDatabasesDB)($database, $this->sourceProject); } - return call_user_func($this->getDatabasesDB, $database); + return ($this->getDatabasesDB)($database); } /** diff --git a/src/Appwrite/SDK/Specification/Format.php b/src/Appwrite/SDK/Specification/Format.php index d10e9446d1..4302c61238 100644 --- a/src/Appwrite/SDK/Specification/Format.php +++ b/src/Appwrite/SDK/Specification/Format.php @@ -309,7 +309,7 @@ abstract class Format case 'createIndex': switch ($param) { case 'type': - return 'IndexType'; + return 'DatabasesIndexType'; case 'orders': return 'OrderBy'; } @@ -342,7 +342,7 @@ abstract class Format case 'createIndex': switch ($param) { case 'type': - return 'IndexType'; + return 'TablesDBIndexType'; case 'orders': return 'OrderBy'; } @@ -361,7 +361,7 @@ abstract class Format case 'createIndex': switch ($param) { case 'type': - return 'IndexType'; + return 'DocumentsDBIndexType'; case 'orders': return 'OrderBy'; } diff --git a/src/Appwrite/Utopia/Database/Validator/Attributes.php b/src/Appwrite/Utopia/Database/Validator/Attributes.php index 839d1d2533..acb04bd97e 100644 --- a/src/Appwrite/Utopia/Database/Validator/Attributes.php +++ b/src/Appwrite/Utopia/Database/Validator/Attributes.php @@ -45,7 +45,7 @@ class Attributes extends Validator /** * @param int $maxAttributes Maximum number of attributes allowed * @param bool $supportForSpatialAttributes Whether DB supports spatial attributes - * @param bool $supportForSpatialAttributes Whether DB supports attributes or not + * @param bool $supportForAttributes Whether DB supports attributes or not */ public function __construct( int $maxAttributes = APP_LIMIT_ARRAY_PARAMS_SIZE, @@ -81,7 +81,7 @@ class Attributes extends Validator } if (\count($value) && !$this->supportForAttributes) { - $this->message = "Attributes are not supported by the current database"; + $this->message = 'Attributes are not supported by the current database'; return false; }