chore: update to return object

This commit is contained in:
Chirag Aggarwal committed 2025-07-22 16:59:05 +05:30
1 parent 2aaaf90044
commit 3128a7b837
3 files changed
+14 -13

No files matched your search

+2 -9
View File
@@ -180,16 +180,9 @@ class Method
return $this->deprecated !== false;
}
public function getDeprecated(): array|null
public function getDeprecated(): bool|Deprecated
{
if ($this->deprecated instanceof Deprecated) {
return [
'since' => $this->deprecated->getSince(),
'replaceWith' => $this->deprecated->getReplaceWith(),
];
}
return null;
return $this->deprecated;
}
public function isHidden(): bool|array
@@ -3,6 +3,7 @@
namespace Appwrite\SDK\Specification\Format;
use Appwrite\SDK\AuthType;
use Appwrite\SDK\Deprecated;
use Appwrite\SDK\Method;
use Appwrite\SDK\MethodType;
use Appwrite\SDK\Response;
@@ -170,8 +171,11 @@ class OpenAPI3 extends Format
],
];
if ($sdk->getDeprecated() !== null) {
$temp['x-appwrite']['deprecated'] = $sdk->getDeprecated();
if ($sdk->getDeprecated() instanceof Deprecated) {
$temp['x-appwrite']['deprecated'] = [
'since' => $sdk->getDeprecated()->getSince(),
'replaceWith' => $sdk->getDeprecated()->getReplaceWith(),
];
}
if (!empty($additionalMethods)) {
@@ -3,6 +3,7 @@
namespace Appwrite\SDK\Specification\Format;
use Appwrite\SDK\AuthType;
use Appwrite\SDK\Deprecated;
use Appwrite\SDK\Method;
use Appwrite\SDK\MethodType;
use Appwrite\SDK\Response;
@@ -174,8 +175,11 @@ class Swagger2 extends Format
],
];
if ($sdk->getDeprecated() !== null) {
$temp['x-appwrite']['deprecated'] = $sdk->getDeprecated();
if ($sdk->getDeprecated() instanceof Deprecated) {
$temp['x-appwrite']['deprecated'] = [
'since' => $sdk->getDeprecated()->getSince(),
'replaceWith' => $sdk->getDeprecated()->getReplaceWith(),
];
}
if ($produces) {