Перевод на доменную архитектуру
This commit is contained in:
15
app/Domain/Reports/Calculators/DepartmentLoadCalculator.php
Normal file
15
app/Domain/Reports/Calculators/DepartmentLoadCalculator.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Reports\Calculators;
|
||||
|
||||
final class DepartmentLoadCalculator
|
||||
{
|
||||
public function calculate(int|float $currentCount, int|float $bedsCount): int
|
||||
{
|
||||
if ($bedsCount <= 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (int) round($currentCount * 100 / $bedsCount);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user