buckets/src/Service/Allocation/Result.php

46 lines
951 B
PHP

<?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;
}
public function getUnallocated(): ?int
{
return $this->unallocated;
}
}