handle case when there are multiple sdk methods

This commit is contained in:
Chirag Aggarwal 2025-07-22 17:27:09 +05:30
parent 3128a7b837
commit e10f1eb10f

View file

@ -1039,10 +1039,11 @@ App::init()
* Deprecation Warning
*/
$sdk = $route->getLabel('sdk', false);
if (!empty($sdk)) {
/** @var \Appwrite\SDK\Method $sdk */
if ($sdk->isDeprecated()) {
$warnings[] = 'This route is deprecated. See the updated documentation for improved compatibility and migration details.';
$deprecationWarning = 'This route is deprecated. See the updated documentation for improved compatibility and migration details.';
$sdkItems = is_array($sdk) ? $sdk : (!empty($sdk) ? [$sdk] : []);
foreach ($sdkItems as $sdkItem) {
if ($sdkItem->isDeprecated()) {
$warnings[] = $deprecationWarning;
}
}