From 49502c489feba92f08421cc50c9792e5bc2f2b92 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 27 May 2026 11:15:57 +0000 Subject: [PATCH] Restore unconditional x-enum-keys assignment The defensive isset re-added in cb6e502 reproduces the PHPStan dead-code error the previous commit fixed. PHPStan correctly infers that within the outer if (isset(\$node['enum'])) branch, x-enum-keys is also always set (the sole upstream path that sets enum unconditionally sets x-enum-keys alongside it). The project's analyze gate forbids suppressing the error via @phpstan-ignore, baseline entries, or casts, so the inner isset must go. --- src/Appwrite/SDK/Specification/Format/Swagger2.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index 9c033399e7..9265e1ec60 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -761,9 +761,7 @@ class Swagger2 extends Format /// If the enum flag is Set, add the enum values to the body $body['schema']['properties'][$name]['enum'] = $node['enum']; $body['schema']['properties'][$name]['x-enum-name'] = $node['x-enum-name'] ?? null; - if (isset($node['x-enum-keys'])) { - $body['schema']['properties'][$name]['x-enum-keys'] = $node['x-enum-keys']; - } + $body['schema']['properties'][$name]['x-enum-keys'] = $node['x-enum-keys']; } if ($parameter['nullable']) {