2026-06-21 23:58:45 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Service\Allocation;
|
|
|
|
|
|
|
|
|
|
use App\Entity\Bucket;
|
|
|
|
|
|
|
|
|
|
class Result
|
|
|
|
|
{
|
|
|
|
|
/** @var list<array{bucket: Bucket, amount: int}> */
|
|
|
|
|
private array $allocations;
|
|
|
|
|
|
|
|
|
|
private int $totalAllocated;
|
|
|
|
|
|
|
|
|
|
private ?int $unallocated = null;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param list<array{bucket: Bucket, amount: int}> $allocations
|
|
|
|
|
*/
|
|
|
|
|
public function __construct(
|
|
|
|
|
array $allocations,
|
|
|
|
|
int $totalAllocated,
|
|
|
|
|
?int $unallocated = 0,
|
|
|
|
|
) {
|
|
|
|
|
$this->allocations = $allocations;
|
|
|
|
|
$this->totalAllocated = $totalAllocated;
|
|
|
|
|
$this->unallocated = $unallocated;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return list<array{bucket: Bucket, amount: int}>
|
|
|
|
|
*/
|
|
|
|
|
public function getAllocations(): array
|
|
|
|
|
{
|
|
|
|
|
return $this->allocations;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getTotalAllocated(): int
|
|
|
|
|
{
|
|
|
|
|
return $this->totalAllocated;
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-22 18:55:02 +02:00
|
|
|
public function getUnallocated(): ?int
|
2026-06-21 23:58:45 +02:00
|
|
|
{
|
|
|
|
|
return $this->unallocated;
|
|
|
|
|
}
|
|
|
|
|
}
|