Merge remote-tracking branch 'origin/master' into cire16

This commit is contained in:
2022-12-22 10:22:58 +01:00
801 changed files with 39243 additions and 6591 deletions

View File

@@ -31,7 +31,9 @@ class ConfigRepository
public function getChargesKeys(bool $onlyActive = false): array
{
return array_map(static function ($element) { return $element['key']; }, $this->getCharges($onlyActive));
return array_map(static function ($element) {
return $element['key'];
}, $this->getCharges($onlyActive));
}
/**
@@ -50,7 +52,9 @@ class ConfigRepository
public function getResourcesKeys(bool $onlyActive = false): array
{
return array_map(static function ($element) { return $element['key']; }, $this->getResources($onlyActive));
return array_map(static function ($element) {
return $element['key'];
}, $this->getResources($onlyActive));
}
/**
@@ -70,14 +74,18 @@ class ConfigRepository
private function getCharges(bool $onlyActive = false): array
{
return $onlyActive ?
array_filter($this->charges, static function ($el) { return $el['active']; })
array_filter($this->charges, static function ($el) {
return $el['active'];
})
: $this->charges;
}
private function getResources(bool $onlyActive = false): array
{
return $onlyActive ?
array_filter($this->resources, static function ($el) { return $el['active']; })
array_filter($this->resources, static function ($el) {
return $el['active'];
})
: $this->resources;
}

View File

@@ -150,7 +150,7 @@ abstract class AbstractElement
return $this;
}
public function setHousehold(Household $household): self
public function setHousehold(?Household $household): self
{
$this->household = $household;

View File

@@ -61,7 +61,9 @@ class SummaryBudget implements SummaryBudgetInterface
];
}
$personIds = $household->getCurrentPersons()->map(static function (Person $p) { return $p->getId(); });
$personIds = $household->getCurrentPersons()->map(static function (Person $p) {
return $p->getId();
});
$ids = implode(', ', array_fill(0, count($personIds), '?'));
$parameters = [...$personIds, $household->getId()];