26 lines
556 B
PHP
26 lines
556 B
PHP
<?php
|
|
|
|
namespace App\Enum;
|
|
|
|
enum BucketType: string
|
|
{
|
|
case NEED = 'need';
|
|
case WANT = 'want';
|
|
case OVERFLOW = 'overflow';
|
|
|
|
/**
|
|
* @return list<BucketAllocationType>
|
|
*/
|
|
public function getAllowedAllocationTypes(): array
|
|
{
|
|
return match ($this) {
|
|
self::NEED, self::WANT => [
|
|
BucketAllocationType::FIXED_LIMIT,
|
|
BucketAllocationType::PERCENTAGE,
|
|
],
|
|
self::OVERFLOW => [
|
|
BucketAllocationType::UNLIMITED,
|
|
],
|
|
};
|
|
}
|
|
}
|