cs: Enable risky rule static_lambda.

This commit is contained in:
Pol Dellaiera
2021-11-30 11:43:34 +01:00
parent a9188355c5
commit 91d12c4a96
111 changed files with 212 additions and 212 deletions

View File

@@ -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];
};
}

View File

@@ -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];
};
}

View File

@@ -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();

View File

@@ -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)) {

View File

@@ -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;
}
));