mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
cs: Enable risky rule static_lambda
.
This commit is contained in:
@@ -147,7 +147,7 @@ final class CountryOfBirthAggregator implements AggregatorInterface, ExportEleme
|
||||
];
|
||||
}
|
||||
|
||||
return function (string $value) use ($labels): string {
|
||||
return static function (string $value) use ($labels): string {
|
||||
return $labels[$value];
|
||||
};
|
||||
}
|
||||
|
@@ -147,7 +147,7 @@ final class NationalityAggregator implements AggregatorInterface, ExportElementV
|
||||
];
|
||||
}
|
||||
|
||||
return function (string $value) use ($labels): string {
|
||||
return static function (string $value) use ($labels): string {
|
||||
return $labels[$value];
|
||||
};
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ class CountPerson implements ExportInterface
|
||||
$labels = array_combine($values, $values);
|
||||
$labels['_header'] = $this->getTitle();
|
||||
|
||||
return function ($value) use ($labels) {
|
||||
return static function ($value) use ($labels) {
|
||||
return $labels[$value];
|
||||
};
|
||||
}
|
||||
@@ -88,7 +88,7 @@ class CountPerson implements ExportInterface
|
||||
*/
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(function ($el) { return $el['center']; }, $acl);
|
||||
$centers = array_map(static function ($el) { return $el['center']; }, $acl);
|
||||
|
||||
$qb = $this->entityManager->createQueryBuilder();
|
||||
|
||||
|
@@ -102,7 +102,7 @@ class ListPerson implements ListInterface, ExportElementValidatedInterface
|
||||
return [];
|
||||
},
|
||||
'constraints' => [new Callback([
|
||||
'callback' => function ($selected, ExecutionContextInterface $context) {
|
||||
'callback' => static function ($selected, ExecutionContextInterface $context) {
|
||||
if (count($selected) === 0) {
|
||||
$context->buildViolation('You must select at least one element')
|
||||
->atPath('fields')
|
||||
@@ -266,7 +266,7 @@ class ListPerson implements ListInterface, ExportElementValidatedInterface
|
||||
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(function ($el) { return $el['center']; }, $acl);
|
||||
$centers = array_map(static function ($el) { return $el['center']; }, $acl);
|
||||
|
||||
// throw an error if any fields are present
|
||||
if (!array_key_exists('fields', $data)) {
|
||||
|
@@ -63,7 +63,7 @@ class GenderFilter implements
|
||||
$qb->add('where', $where);
|
||||
$qb->setParameter('person_gender', array_filter(
|
||||
$data['accepted_genders'],
|
||||
function ($el) {
|
||||
static function ($el) {
|
||||
return 'null' !== $el;
|
||||
}
|
||||
));
|
||||
|
Reference in New Issue
Block a user