mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Implements return types on aggregators
This commit is contained in:
parent
ec5f4ed1d6
commit
0d0a626f50
@ -61,7 +61,7 @@ class ByActivityNumberAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return static function ($value) {
|
||||
if ('_header' === $value) {
|
||||
|
@ -69,7 +69,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
|
||||
];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return function (int|string|null $value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -67,7 +67,7 @@ class BySocialActionAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value) {
|
||||
if ('_header' === $value) {
|
||||
|
@ -67,7 +67,7 @@ class BySocialIssueAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -64,7 +64,7 @@ final readonly class ActivityLocationAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -44,7 +44,7 @@ final readonly class ActivityPresenceAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return function (int|string|null $value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -111,7 +111,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
||||
];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value) use ($data) {
|
||||
if ('_header' === $value) {
|
||||
|
@ -69,7 +69,7 @@ class ActivityTypeAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function (int|string|null $value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -68,7 +68,7 @@ class ActivityUserAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, $values, $data): \Closure
|
||||
public function getLabels($key, $values, $data): callable
|
||||
{
|
||||
return function ($value) {
|
||||
if ('_header' === $value) {
|
||||
|
@ -68,7 +68,7 @@ class ActivityUsersAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value) {
|
||||
if ('_header' === $value) {
|
||||
|
@ -87,7 +87,7 @@ class ActivityUsersJobAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -87,7 +87,7 @@ class ActivityUsersScopeAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -63,7 +63,7 @@ class ByCreatorAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -67,7 +67,7 @@ class ByThirdpartyAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -87,7 +87,7 @@ class CreatorJobAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -87,7 +87,7 @@ class CreatorScopeAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -96,7 +96,7 @@ class DateAggregator implements AggregatorInterface
|
||||
return ['frequency' => self::DEFAULT_CHOICE];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return static function ($value) use ($data): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -67,7 +67,7 @@ class LocationTypeAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -49,7 +49,7 @@ final readonly class HouseholdAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return function (int|string|null $value): string|int {
|
||||
if ('_header' === $value) {
|
||||
|
@ -46,7 +46,7 @@ final readonly class PersonAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.person.by_person.person');
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ final readonly class PersonsAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
if ($key !== self::PREFIX.'_pid') {
|
||||
throw new \UnexpectedValueException('this key should not be handled: '.$key);
|
||||
|
@ -66,7 +66,7 @@ class ByActivityTypeAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -46,7 +46,7 @@ class ByLocationAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -87,7 +87,7 @@ class ByUserJobAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -86,7 +86,7 @@ class ByUserScopeAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -67,7 +67,7 @@ final readonly class AgentAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -68,7 +68,7 @@ class CancelReasonAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -87,7 +87,7 @@ final readonly class JobAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -65,7 +65,7 @@ final readonly class LocationAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -67,7 +67,7 @@ final readonly class LocationTypeAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -60,7 +60,7 @@ class MonthYearAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return static function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -87,7 +87,7 @@ final readonly class ScopeAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -69,7 +69,7 @@ class UrgencyAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -96,7 +96,7 @@ class EventDateAggregator implements AggregatorInterface
|
||||
return ['frequency' => self::DEFAULT_CHOICE];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return static function ($value) use ($data): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -69,7 +69,7 @@ class EventTypeAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function (int|string|null $value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -69,7 +69,7 @@ class RoleAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function (int|string|null $value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -19,7 +19,7 @@ trait ExportDataNormalizerTrait
|
||||
/**
|
||||
* @param object|list<object> $entity
|
||||
*/
|
||||
public function normalizeDoctrineEntity(object|array $entity): array|int
|
||||
public function normalizeDoctrineEntity(object|array|null $entity): array|int
|
||||
{
|
||||
if (is_array($entity)) {
|
||||
return array_values(array_filter(array_map(static fn (object $entity) => $entity->getId(), $entity), fn ($value) => null !== $value));
|
||||
|
@ -141,7 +141,7 @@ class SortExportElementTest extends KernelTestCase
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return fn ($v) => $v;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ class AdministrativeLocationAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -60,7 +60,7 @@ class ByActionNumberAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return static function ($value) {
|
||||
if ('_header' === $value) {
|
||||
|
@ -61,7 +61,7 @@ final readonly class ClosingDateAggregator implements AggregatorInterface
|
||||
];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return function (?string $value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -63,7 +63,7 @@ class ClosingMotiveAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -62,7 +62,7 @@ class ConfidentialAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -100,7 +100,7 @@ class CreatorJobAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -85,7 +85,7 @@ final readonly class DurationAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return static function ($value) use ($data) {
|
||||
if ('_header' === $value) {
|
||||
|
@ -62,7 +62,7 @@ class EmergencyAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -71,7 +71,7 @@ final readonly class EvaluationAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -149,7 +149,7 @@ final readonly class GeographicalUnitStatAggregator implements AggregatorInterfa
|
||||
return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return match ($key) {
|
||||
'acp_geog_agg_unitname' => static function ($value): string {
|
||||
|
@ -62,7 +62,7 @@ class IntensityAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -94,7 +94,7 @@ final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function (int|string|null $jobId) {
|
||||
if (null === $jobId || '' === $jobId) {
|
||||
|
@ -61,7 +61,7 @@ final readonly class OpeningDateAggregator implements AggregatorInterface
|
||||
];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return function (?string $value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -76,7 +76,7 @@ final readonly class OriginAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -50,7 +50,7 @@ final readonly class PersonParticipatingAggregator implements AggregatorInterfac
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return match ($key) {
|
||||
self::KEY => $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.course.by-user.header'),
|
||||
|
@ -117,7 +117,7 @@ final readonly class ReferrerAggregator implements AggregatorInterface, DataTran
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -123,7 +123,7 @@ readonly class ReferrerScopeAggregator implements AggregatorInterface, DataTrans
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value) {
|
||||
if ('_header' === $value) {
|
||||
|
@ -83,7 +83,7 @@ final readonly class RequestorAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -67,7 +67,7 @@ final readonly class ScopeAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -94,7 +94,7 @@ final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterfa
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function (int|string|null $scopeId) {
|
||||
if (null === $scopeId || '' === $scopeId) {
|
||||
|
@ -68,7 +68,7 @@ final readonly class SocialActionAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value) {
|
||||
if ('_header' === $value) {
|
||||
|
@ -68,7 +68,7 @@ final readonly class SocialIssueAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -88,7 +88,7 @@ final readonly class StepAggregator implements AggregatorInterface
|
||||
return ['on_date' => new RollingDate(RollingDate::T_TODAY)];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
switch ($value) {
|
||||
|
@ -123,7 +123,7 @@ final readonly class UserJobAggregator implements AggregatorInterface, DataTrans
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -54,7 +54,7 @@ final readonly class UserWorkingOnCourseAggregator implements AggregatorInterfac
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): closure
|
||||
{
|
||||
return function (int|string|null $userId) {
|
||||
if (null === $userId || '' === $userId) {
|
||||
|
@ -52,7 +52,7 @@ final readonly class ByClosingMotiveAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return function (int|string|null $value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -59,7 +59,7 @@ final readonly class ByDateAggregator implements AggregatorInterface
|
||||
return ['frequency' => DateGroupingChoiceEnum::YEAR->value];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return function (?string $value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -54,7 +54,7 @@ final readonly class ByStepAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return function (?string $step): string {
|
||||
if ('_header' === $step) {
|
||||
|
@ -81,7 +81,7 @@ final class ByEndDateAggregator implements AggregatorInterface
|
||||
return ['frequency' => self::DEFAULT_CHOICE];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return static function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -81,7 +81,7 @@ final class ByMaxDateAggregator implements AggregatorInterface
|
||||
return ['frequency' => self::DEFAULT_CHOICE];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return static function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -81,7 +81,7 @@ final class ByStartDateAggregator implements AggregatorInterface
|
||||
return ['frequency' => self::DEFAULT_CHOICE];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return static function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -63,7 +63,7 @@ class EvaluationTypeAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -63,7 +63,7 @@ class HavingEndDateAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -83,7 +83,7 @@ class ChildrenNumberAggregator implements AggregatorInterface
|
||||
return ['on_date' => new RollingDate(RollingDate::T_TODAY)];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return static function (int|string|null $value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -85,7 +85,7 @@ class CompositionAggregator implements AggregatorInterface
|
||||
return ['on_date' => new RollingDate(RollingDate::T_TODAY)];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -62,7 +62,7 @@ final readonly class AdministrativeStatusAggregator implements AggregatorInterfa
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -70,7 +70,7 @@ final readonly class AgeAggregator implements AggregatorInterface, ExportElement
|
||||
return ['date_age_calculation' => new RollingDate(RollingDate::T_TODAY)];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value) {
|
||||
if ('_header' === $value) {
|
||||
|
@ -103,7 +103,7 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface
|
||||
return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value) {
|
||||
if ('_header' === $value) {
|
||||
|
@ -58,7 +58,7 @@ final readonly class CenterAggregator implements AggregatorInterface
|
||||
];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data): \Closure
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function (int|string|null $value) {
|
||||
if (null === $value || '' === $value) {
|
||||
|
@ -112,7 +112,7 @@ final readonly class CountryOfBirthAggregator implements AggregatorInterface, Ex
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
$labels = [];
|
||||
|
||||
|
@ -62,7 +62,7 @@ final readonly class EmploymentStatusAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -63,7 +63,7 @@ final readonly class GenderAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function (int|string|null $value) {
|
||||
if (null === $value || '' === $value) {
|
||||
|
@ -127,7 +127,7 @@ final readonly class GeographicalUnitAggregator implements AggregatorInterface
|
||||
return 'person_geog_agg';
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return match ($key) {
|
||||
'geog_unit_name' => static function ($value): string {
|
||||
|
@ -94,7 +94,7 @@ final readonly class HouseholdPositionAggregator implements AggregatorInterface,
|
||||
return ['date_position' => new RollingDate(RollingDate::T_TODAY)];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value) {
|
||||
if ('_header' === $value) {
|
||||
|
@ -67,7 +67,7 @@ final readonly class MaritalStatusAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -109,7 +109,7 @@ final readonly class NationalityAggregator implements AggregatorInterface, Expor
|
||||
];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
$labels = [];
|
||||
|
||||
|
@ -56,7 +56,7 @@ final readonly class PostalCodeAggregator implements AggregatorInterface
|
||||
return ['calc_date' => new RollingDate(RollingDate::T_TODAY)];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return function (int|string|null $value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -76,7 +76,7 @@ final readonly class ActionTypeAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return match ($key) {
|
||||
'action_type_aggregator' => function ($value): string {
|
||||
|
@ -68,7 +68,7 @@ class CreatorAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -85,7 +85,7 @@ class CreatorJobAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -85,7 +85,7 @@ class CreatorScopeAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -66,7 +66,7 @@ class CurrentActionAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -67,7 +67,7 @@ final readonly class GoalAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -73,7 +73,7 @@ class GoalResultAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value) use ($key): string {
|
||||
if (null === $value || '' === $value) {
|
||||
|
@ -52,7 +52,7 @@ final readonly class HandlingThirdPartyAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, mixed $data)
|
||||
public function getLabels($key, array $values, mixed $data): callable
|
||||
{
|
||||
return $this->labelThirdPartyHelper->getLabel($key, $values, 'export.aggregator.course_work.by_handling_third_party.header');
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ final readonly class JobAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -85,7 +85,7 @@ final readonly class ReferrerAggregator implements AggregatorInterface
|
||||
];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -67,7 +67,7 @@ final readonly class ResultAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -80,7 +80,7 @@ final readonly class ScopeAggregator implements AggregatorInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
|
@ -26,6 +26,7 @@ use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Translation\TranslatableMessage;
|
||||
|
||||
class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface
|
||||
{
|
||||
@ -102,9 +103,9 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface
|
||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||
}
|
||||
|
||||
public function getTitle(): string
|
||||
public function getTitle(): TranslatableMessage
|
||||
{
|
||||
return 'Count accompanying courses';
|
||||
return new TranslatableMessage('Count accompanying courses');
|
||||
}
|
||||
|
||||
public function getType(): string
|
||||
|
@ -21,6 +21,7 @@ use Doctrine\ORM\Query\Expr\Join;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Translation\TranslatableMessage;
|
||||
|
||||
final readonly class CreatorJobFilter implements FilterInterface
|
||||
{
|
||||
@ -114,19 +115,19 @@ final readonly class CreatorJobFilter implements FilterInterface
|
||||
return ['creator_job' => $this->denormalizeDoctrineEntity($formData['creator_job'], $this->userJobRepository)];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
public function describeAction($data, $format = 'string'): TranslatableMessage
|
||||
{
|
||||
$creatorJobs = [];
|
||||
|
||||
foreach ($data['creator_job'] as $j) {
|
||||
$creatorJobs[] = $this->translatableStringHelper->localize(
|
||||
$j->getLabel()
|
||||
$j->getLabel(),
|
||||
);
|
||||
}
|
||||
|
||||
return ['export.filter.course.creator_job.Filtered by creator job: only %jobs%', [
|
||||
return new TranslatableMessage('export.filter.course.creator_job.Filtered by creator job: only %jobs%', [
|
||||
'%jobs%' => implode(', ', $creatorJobs),
|
||||
]];
|
||||
]);
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
@ -136,8 +137,8 @@ final readonly class CreatorJobFilter implements FilterInterface
|
||||
];
|
||||
}
|
||||
|
||||
public function getTitle(): string
|
||||
public function getTitle(): TranslatableMessage
|
||||
{
|
||||
return 'export.filter.course.creator_job.Filter by creator job';
|
||||
return new TranslatableMessage('export.filter.course.creator_job.Filter by creator job');
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,9 @@ use Chill\PersonBundle\Export\Declarations;
|
||||
use Chill\ReportBundle\Entity\Report;
|
||||
use Chill\ReportBundle\Security\Authorization\ReportVoter;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\NativeQuery;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Validator\Constraints\Callback;
|
||||
@ -34,7 +36,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
* @template-implements ListInterface<array>
|
||||
* @template-implements ListInterface<QueryBuilder, array{fields: list<string>, address_date: \DateTime}>
|
||||
*/
|
||||
class ReportList implements ExportElementValidatedInterface, ListInterface
|
||||
{
|
||||
@ -286,7 +288,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface
|
||||
return [...$fields, ...\array_keys($this->slugs)];
|
||||
}
|
||||
|
||||
public function getResult($query, $data, \Chill\MainBundle\Export\ExportGenerationContext $context): array
|
||||
public function getResult(QueryBuilder|NativeQuery $query, $data, \Chill\MainBundle\Export\ExportGenerationContext $context): array
|
||||
{
|
||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user