mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 19:43:49 +00:00
cs: Second part - ignore test/app
subdirectory.
This commit is contained in:
@@ -125,24 +125,24 @@ class ActivityType extends AbstractType
|
||||
$builder->get('socialIssues')
|
||||
->addModelTransformer(new CallbackTransformer(
|
||||
function (iterable $socialIssuesAsIterable): string {
|
||||
$socialIssueIds = [];
|
||||
$socialIssueIds = [];
|
||||
|
||||
foreach ($socialIssuesAsIterable as $value) {
|
||||
$socialIssueIds[] = $value->getId();
|
||||
}
|
||||
foreach ($socialIssuesAsIterable as $value) {
|
||||
$socialIssueIds[] = $value->getId();
|
||||
}
|
||||
|
||||
return implode(',', $socialIssueIds);
|
||||
},
|
||||
return implode(',', $socialIssueIds);
|
||||
},
|
||||
function (?string $socialIssuesAsString): array {
|
||||
if (null === $socialIssuesAsString) {
|
||||
return [];
|
||||
}
|
||||
if (null === $socialIssuesAsString) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return array_map(
|
||||
fn (string $id): ?SocialIssue => $this->om->getRepository(SocialIssue::class)->findOneBy(['id' => (int) $id]),
|
||||
explode(',', $socialIssuesAsString)
|
||||
);
|
||||
}
|
||||
return array_map(
|
||||
fn (string $id): ?SocialIssue => $this->om->getRepository(SocialIssue::class)->findOneBy(['id' => (int) $id]),
|
||||
explode(',', $socialIssuesAsString)
|
||||
);
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
@@ -151,24 +151,24 @@ class ActivityType extends AbstractType
|
||||
$builder->get('socialActions')
|
||||
->addModelTransformer(new CallbackTransformer(
|
||||
function (iterable $socialActionsAsIterable): string {
|
||||
$socialActionIds = [];
|
||||
$socialActionIds = [];
|
||||
|
||||
foreach ($socialActionsAsIterable as $value) {
|
||||
$socialActionIds[] = $value->getId();
|
||||
}
|
||||
foreach ($socialActionsAsIterable as $value) {
|
||||
$socialActionIds[] = $value->getId();
|
||||
}
|
||||
|
||||
return implode(',', $socialActionIds);
|
||||
},
|
||||
return implode(',', $socialActionIds);
|
||||
},
|
||||
function (?string $socialActionsAsString): array {
|
||||
if (null === $socialActionsAsString) {
|
||||
return [];
|
||||
}
|
||||
if (null === $socialActionsAsString) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return array_map(
|
||||
fn (string $id): ?SocialAction => $this->om->getRepository(SocialAction::class)->findOneBy(['id' => (int) $id]),
|
||||
explode(',', $socialActionsAsString)
|
||||
);
|
||||
}
|
||||
return array_map(
|
||||
fn (string $id): ?SocialAction => $this->om->getRepository(SocialAction::class)->findOneBy(['id' => (int) $id]),
|
||||
explode(',', $socialActionsAsString)
|
||||
);
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
@@ -248,20 +248,20 @@ class ActivityType extends AbstractType
|
||||
$builder->get('persons')
|
||||
->addModelTransformer(new CallbackTransformer(
|
||||
function (iterable $personsAsIterable): string {
|
||||
$personIds = [];
|
||||
$personIds = [];
|
||||
|
||||
foreach ($personsAsIterable as $value) {
|
||||
$personIds[] = $value->getId();
|
||||
}
|
||||
foreach ($personsAsIterable as $value) {
|
||||
$personIds[] = $value->getId();
|
||||
}
|
||||
|
||||
return implode(',', $personIds);
|
||||
},
|
||||
return implode(',', $personIds);
|
||||
},
|
||||
function (?string $personsAsString): array {
|
||||
return array_map(
|
||||
fn (string $id): ?Person => $this->om->getRepository(Person::class)->findOneBy(['id' => (int) $id]),
|
||||
explode(',', $personsAsString)
|
||||
);
|
||||
}
|
||||
return array_map(
|
||||
fn (string $id): ?Person => $this->om->getRepository(Person::class)->findOneBy(['id' => (int) $id]),
|
||||
explode(',', $personsAsString)
|
||||
);
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
@@ -270,20 +270,20 @@ class ActivityType extends AbstractType
|
||||
$builder->get('thirdParties')
|
||||
->addModelTransformer(new CallbackTransformer(
|
||||
function (iterable $thirdpartyAsIterable): string {
|
||||
$thirdpartyIds = [];
|
||||
$thirdpartyIds = [];
|
||||
|
||||
foreach ($thirdpartyAsIterable as $value) {
|
||||
$thirdpartyIds[] = $value->getId();
|
||||
}
|
||||
foreach ($thirdpartyAsIterable as $value) {
|
||||
$thirdpartyIds[] = $value->getId();
|
||||
}
|
||||
|
||||
return implode(',', $thirdpartyIds);
|
||||
},
|
||||
return implode(',', $thirdpartyIds);
|
||||
},
|
||||
function (?string $thirdpartyAsString): array {
|
||||
return array_map(
|
||||
fn (string $id): ?ThirdParty => $this->om->getRepository(ThirdParty::class)->findOneBy(['id' => (int) $id]),
|
||||
explode(',', $thirdpartyAsString)
|
||||
);
|
||||
}
|
||||
return array_map(
|
||||
fn (string $id): ?ThirdParty => $this->om->getRepository(ThirdParty::class)->findOneBy(['id' => (int) $id]),
|
||||
explode(',', $thirdpartyAsString)
|
||||
);
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
@@ -303,20 +303,20 @@ class ActivityType extends AbstractType
|
||||
$builder->get('users')
|
||||
->addModelTransformer(new CallbackTransformer(
|
||||
function (iterable $usersAsIterable): string {
|
||||
$userIds = [];
|
||||
$userIds = [];
|
||||
|
||||
foreach ($usersAsIterable as $value) {
|
||||
$userIds[] = $value->getId();
|
||||
}
|
||||
foreach ($usersAsIterable as $value) {
|
||||
$userIds[] = $value->getId();
|
||||
}
|
||||
|
||||
return implode(',', $userIds);
|
||||
},
|
||||
return implode(',', $userIds);
|
||||
},
|
||||
function (?string $usersAsString): array {
|
||||
return array_map(
|
||||
fn (string $id): ?User => $this->om->getRepository(User::class)->findOneBy(['id' => (int) $id]),
|
||||
explode(',', $usersAsString)
|
||||
);
|
||||
}
|
||||
return array_map(
|
||||
fn (string $id): ?User => $this->om->getRepository(User::class)->findOneBy(['id' => (int) $id]),
|
||||
explode(',', $usersAsString)
|
||||
);
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user