cs: Fix code style (safe rules only).

This commit is contained in:
Pol Dellaiera
2021-11-23 14:06:38 +01:00
parent 149d7ce991
commit 8f96a1121d
1223 changed files with 65199 additions and 64625 deletions

View File

@@ -1,72 +1,68 @@
<?php
/*
*/
namespace Chill\AMLI\BudgetBundle\Config;
/**
*
* Chill is a software for social workers
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AMLI\BudgetBundle\Config;
class ConfigRepository
{
/**
*
* @var array
*/
protected $resources;
/**
*
* @var array
*/
protected $charges;
/**
* @var array
*/
protected $resources;
public function __construct($resources, $charges)
{
$this->resources = $resources;
$this->charges = $charges;
}
/**
*
* @return array where keys are the resource'key and label the ressource label
*/
public function getResourcesLabels()
{
$resources = array();
foreach ($this->resources as $definition) {
$resources[$definition['key']] = $this->normalizeLabel($definition['labels']);
}
return $resources;
}
/**
*
* @return array where keys are the resource'key and label the ressource label
*/
public function getChargesLabels()
{
$charges = array();
$charges = [];
foreach ($this->charges as $definition) {
$charges[$definition['key']] = $this->normalizeLabel($definition['labels']);
}
return $charges;
}
private function normalizeLabel($labels)
/**
* @return array where keys are the resource'key and label the ressource label
*/
public function getResourcesLabels()
{
$normalizedLabels = array();
$resources = [];
foreach ($this->resources as $definition) {
$resources[$definition['key']] = $this->normalizeLabel($definition['labels']);
}
return $resources;
}
private function normalizeLabel($labels)
{
$normalizedLabels = [];
foreach ($labels as $labelDefinition) {
$normalizedLabels[$labelDefinition['lang']] = $labelDefinition['label'];
}
return $normalizedLabels;
}
}