(fix): convert V17 filter method string to Method enum and update database

V17 request filter switch compared raw strings against Method enum
cases which never matched in PHP 8.1+. Use Method::tryFrom() to convert
the parsed method string to the enum before the switch.

Also updates utopia-php/database with skipValidation for internal
metadata document updates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jake Barnby
2026-03-31 20:32:02 +13:00
parent a9fd6c6282
commit ead8e37699
2 changed files with 5 additions and 5 deletions
Generated
+4 -4
View File
@@ -4038,12 +4038,12 @@
"source": {
"type": "git",
"url": "https://github.com/utopia-php/database.git",
"reference": "89e7afcc42863673766df3007c8f2feed31445e2"
"reference": "2c3cc096347fa2372b8a33545c9f32eeef338a1c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/89e7afcc42863673766df3007c8f2feed31445e2",
"reference": "89e7afcc42863673766df3007c8f2feed31445e2",
"url": "https://api.github.com/repos/utopia-php/database/zipball/2c3cc096347fa2372b8a33545c9f32eeef338a1c",
"reference": "2c3cc096347fa2372b8a33545c9f32eeef338a1c",
"shasum": ""
},
"require": {
@@ -4091,7 +4091,7 @@
"issues": "https://github.com/utopia-php/database/issues",
"source": "https://github.com/utopia-php/database/tree/feat-query-lib"
},
"time": "2026-03-31T06:36:52+00:00"
"time": "2026-03-31T07:31:28+00:00"
},
{
"name": "utopia-php/detector",
+1 -1
View File
@@ -95,7 +95,7 @@ class V17 extends Filter
throw new \Exception('Invalid query');
}
$method = \mb_substr($filter, 0, $paramsStart);
$method = Method::tryFrom(\mb_substr($filter, 0, $paramsStart)) ?? \mb_substr($filter, 0, $paramsStart);
// Separate params from filter
$paramsEnd = \strlen($filter) - 1; // -1 to ignore )