cs: Second part - ignore test/app subdirectory.

This commit is contained in:
Pol Dellaiera
2021-11-23 14:34:34 +01:00
parent 5f37304796
commit 3ea35682eb
72 changed files with 326 additions and 365 deletions

View File

@@ -120,7 +120,7 @@ class EventController extends AbstractController
$this->addFlash(
'success',
$this->get('translator')
->trans('The event has been sucessfully removed')
->trans('The event has been sucessfully removed')
);
return $this->redirectToRoute('chill_main_search', [

View File

@@ -275,7 +275,7 @@ class ParticipationController extends AbstractController
$this->addFlash(
'success',
$this->get('translator')
->trans('The participation has been sucessfully removed')
->trans('The participation has been sucessfully removed')
);
return $this->redirectToRoute('chill_event__event_show', [
@@ -551,8 +551,7 @@ class ParticipationController extends AbstractController
Request $request,
Participation $participation,
bool $multiple = false
)
{
) {
$em = $this->getDoctrine()->getManager();
if ($em->contains($participation)) {
@@ -653,8 +652,8 @@ class ParticipationController extends AbstractController
$ignoredParticipations[] = $participation
->getEvent()->getParticipations()->filter(
function (Participation $p) use ($participation) {
return $p->getPerson()->getId() === $participation->getPerson()->getId();
}
return $p->getPerson()->getId() === $participation->getPerson()->getId();
}
)->first();
} else {
$newParticipations[] = $participation;

View File

@@ -45,8 +45,8 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa
->setCenter($center)
->setCircle(
$this->getReference(
LoadScopes::$references[array_rand(LoadScopes::$references)]
)
LoadScopes::$references[array_rand(LoadScopes::$references)]
)
);
$manager->persist($event);
$events[] = $event;

View File

@@ -70,20 +70,20 @@ class PickRoleType extends AbstractType
$builder->addEventListener(
FormEvents::PRE_SET_DATA,
function (FormEvent $event) use ($options) {
if (null === $options['event_type']) {
$form = $event->getForm();
$name = $form->getName();
$config = $form->getConfig();
$type = $config->getType()->getName();
$options = $config->getOptions();
if (null === $options['event_type']) {
$form = $event->getForm();
$name = $form->getName();
$config = $form->getConfig();
$type = $config->getType()->getName();
$options = $config->getOptions();
$form->getParent()->add($name, $type, array_replace($options, [
'group_by' => function (Role $r) {
return $this->translatableStringHelper->localize($r->getType()->getName());
},
]));
}
}
$form->getParent()->add($name, $type, array_replace($options, [
'group_by' => function (Role $r) {
return $this->translatableStringHelper->localize($r->getType()->getName());
},
]));
}
}
);
}
}

View File

@@ -74,17 +74,17 @@ class PickStatusType extends AbstractType
$builder->addEventListener(
FormEvents::PRE_SET_DATA,
function (FormEvent $event) {
$form = $event->getForm();
$name = $form->getName();
$config = $form->getConfig();
$type = $config->getType()->getName();
$options = $config->getOptions();
$form->getParent()->add($name, $type, array_replace($options, [
'group_by' => function (Status $s) {
return $this->translatableStringHelper->localize($s->getType()->getName());
},
]));
}
$form = $event->getForm();
$name = $form->getName();
$config = $form->getConfig();
$type = $config->getType()->getName();
$options = $config->getOptions();
$form->getParent()->add($name, $type, array_replace($options, [
'group_by' => function (Status $s) {
return $this->translatableStringHelper->localize($s->getType()->getName());
},
]));
}
);
}
}

View File

@@ -92,8 +92,7 @@ class EventSearch extends AbstractSearch
$limit = 50,
array $options = [],
$format = 'html'
)
{
) {
$total = $this->count($terms);
$paginator = $this->paginationFactory->create($total);

View File

@@ -235,9 +235,9 @@ class ParticipationControllerTest extends WebTestCase
$this->personsIdsCache = array_merge(
$this->personsIdsCache,
$event->getParticipations()->map(
function ($p) { return $p->getPerson()->getId(); }
)
->toArray()
function ($p) { return $p->getPerson()->getId(); }
)
->toArray()
);
// get some random people
$person1 = $this->getRandomPerson();
@@ -476,8 +476,7 @@ class ParticipationControllerTest extends WebTestCase
protected function getRandomEventWithMultipleParticipations(
$centerName = 'Center A',
$circleName = 'social'
)
{
) {
$event = $this->getRandomEvent($centerName, $circleName);
return $event->getParticipations()->count() > 1 ?