Ditch using an enum, use class

This commit is contained in:
Bradley Schofield 2024-08-05 16:16:24 +09:00
parent 4c56de8348
commit fb474734fe
2 changed files with 10 additions and 11 deletions

View file

@ -3,22 +3,22 @@
use Appwrite\Functions\Specifications;
return [
Specifications::S_1VCPU_512MB->value => [
Specifications::$S_1VCPU_512MB => [
'slug' => 's-1vcpu-512mb',
'memory' => 512,
'cpus' => 1
],
Specifications::S_1VCPU_1GB->value => [
Specifications::$S_1VCPU_1GB => [
'slug' => 's-1vcpu-1gb',
'memory' => 1024,
'cpus' => 1
],
Specifications::S_2VCPU_2GB->value => [
Specifications::$S_2VCPU_2GB => [
'slug' => 's-2vcpu-2gb',
'memory' => 2048,
'cpus' => 2
],
Specifications::S_2VCPU_4GB->value => [
Specifications::$S_2VCPU_4GB => [
'slug' => 's-2vcpu-4gb',
'memory' => 4096,
'cpus' => 2

View file

@ -2,10 +2,9 @@
namespace Appwrite\Functions;
enum Specifications: string
{
case S_1VCPU_512MB = 's-1vcpu-512mb';
case S_1VCPU_1GB = 's-1vcpu-1gb';
case S_2VCPU_2GB = 's-2vcpu-2gb';
case S_2VCPU_4GB = 's-2vcpu-4gb';
}
class Specifications {
static $S_1VCPU_512MB = 's-1vcpu-512mb';
static $S_1VCPU_1GB = 's-1vcpu-1gb';
static $S_2VCPU_2GB = 's-2vcpu-2gb';
static $S_2VCPU_4GB = 's-2vcpu-4gb';
}