mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
cs: Enable risky rule static_lambda
.
This commit is contained in:
@@ -100,7 +100,7 @@ class ReportList implements ListInterface, ExportElementValidatedInterface
|
||||
'expanded' => true,
|
||||
'choices' => $choices,
|
||||
'label' => 'Fields to include in export',
|
||||
'choice_attr' => function ($val, $key, $index) {
|
||||
'choice_attr' => static function ($val, $key, $index) {
|
||||
// add a 'data-display-target' for address fields
|
||||
if (substr($val, 0, 8) === 'address_') {
|
||||
return ['data-display-target' => 'address_date'];
|
||||
@@ -124,7 +124,7 @@ class ReportList implements ListInterface, ExportElementValidatedInterface
|
||||
}
|
||||
},
|
||||
'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')
|
||||
@@ -165,7 +165,7 @@ class ReportList implements ListInterface, ExportElementValidatedInterface
|
||||
case 'report_date':
|
||||
// for birthdate or report date, we have to transform the string into a date
|
||||
// to format the date correctly.
|
||||
return function ($value) use ($key) {
|
||||
return static function ($value) use ($key) {
|
||||
if ('_header' === $value) {
|
||||
return 'person_birthdate' === $key ? 'birthdate' : 'report_date';
|
||||
}
|
||||
@@ -202,7 +202,7 @@ class ReportList implements ListInterface, ExportElementValidatedInterface
|
||||
$scopes[$row['id']] = $this->translatableStringHelper->localize($row['name']);
|
||||
}
|
||||
|
||||
return function ($value) use ($scopes): string {
|
||||
return static function ($value) use ($scopes): string {
|
||||
if ('_header' === $value) {
|
||||
return 'circle';
|
||||
}
|
||||
@@ -224,7 +224,7 @@ class ReportList implements ListInterface, ExportElementValidatedInterface
|
||||
$users[$row['id']] = $row['username'];
|
||||
}
|
||||
|
||||
return function ($value) use ($users): string {
|
||||
return static function ($value) use ($users): string {
|
||||
if ('_header' === $value) {
|
||||
return 'user';
|
||||
}
|
||||
@@ -282,7 +282,7 @@ class ReportList implements ListInterface, ExportElementValidatedInterface
|
||||
default:
|
||||
// for fields which are associated with person
|
||||
if (in_array($key, $this->fields)) {
|
||||
return function ($value) use ($key) {
|
||||
return static function ($value) use ($key) {
|
||||
if ('_header' === $value) {
|
||||
return strtolower($key);
|
||||
}
|
||||
@@ -331,7 +331,7 @@ class ReportList 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)) {
|
||||
@@ -503,7 +503,7 @@ class ReportList implements ListInterface, ExportElementValidatedInterface
|
||||
private function getCustomFields()
|
||||
{
|
||||
return array_filter($this->customfieldsGroup
|
||||
->getCustomFields()->toArray(), function (CustomField $cf) {
|
||||
->getCustomFields()->toArray(), static function (CustomField $cf) {
|
||||
return $cf->getType() !== 'title';
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user