buckets/src/Enum/BucketType.php

27 lines
556 B
PHP
Raw Normal View History

2026-06-18 21:25:39 +02:00
<?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,
],
};
}
}