DX: more code style fixes

This commit is contained in:
2022-11-02 14:06:10 +01:00
parent c872ca7204
commit 60f93f7f12
21 changed files with 131 additions and 47 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;
}