Rector changes and immplementations of required methods

This commit is contained in:
2025-05-22 17:47:07 +02:00
parent 053b92b77c
commit 17db59d221
1138 changed files with 2656 additions and 2616 deletions

View File

@@ -24,7 +24,7 @@ class AdminController extends AbstractController
* Event admin.
*/
#[Route(path: '/{_locale}/admin/event', name: 'chill_event_admin_index')]
public function indexAdminAction()
public function indexAdminAction(): \Symfony\Component\HttpFoundation\Response
{
return $this->render('@ChillEvent/Admin/index.html.twig');
}

View File

@@ -160,7 +160,7 @@ final class EventController extends AbstractController
}
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/event/most_recent', name: 'chill_event_list_most_recent', options: [null])]
public function mostRecentIndexAction()
public function mostRecentIndexAction(): \Symfony\Component\HttpFoundation\RedirectResponse
{
return $this->redirectToRoute('chill_main_search', [
'q' => '@event',
@@ -331,7 +331,7 @@ final class EventController extends AbstractController
*
* @return \Symfony\Component\Form\FormInterface
*/
protected function createAddEventParticipationByPersonForm(Person $person)
protected function createAddEventParticipationByPersonForm(Person $person): \Symfony\Component\Form\FormInterface
{
/** @var \Symfony\Component\Form\FormBuilderInterface $builder */
$builder = $this
@@ -378,7 +378,7 @@ final class EventController extends AbstractController
*
* @return \Symfony\Component\Form\FormInterface
*/
protected function createAddParticipationByPersonForm(Event $event)
protected function createAddParticipationByPersonForm(Event $event): \Symfony\Component\Form\FormInterface
{
$builder = $this->formFactoryInterface
->createNamedBuilder(
@@ -409,7 +409,7 @@ final class EventController extends AbstractController
/**
* @return \Symfony\Component\Form\FormInterface
*/
protected function createExportByFormatForm()
protected function createExportByFormatForm(): \Symfony\Component\Form\FormInterface
{
$builder = $this->createFormBuilder(['format' => 'xlsx'])
->add('format', ChoiceType::class, [
@@ -433,7 +433,7 @@ final class EventController extends AbstractController
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
protected function createExportSpreadsheet(Event $event)
protected function createExportSpreadsheet(Event $event): \PhpOffice\PhpSpreadsheet\Spreadsheet
{
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
@@ -577,7 +577,7 @@ final class EventController extends AbstractController
/**
* @return \Symfony\Component\Form\FormInterface
*/
private function createDeleteForm($event_id)
private function createDeleteForm($event_id): \Symfony\Component\Form\FormInterface
{
return $this->createFormBuilder()
->setAction($this->generateUrl('chill_event__event_delete', [

View File

@@ -28,7 +28,7 @@ class EventTypeController extends AbstractController
* Creates a new EventType entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/event_type/create', name: 'chill_eventtype_admin_create', methods: ['POST'])]
public function createAction(Request $request)
public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
$entity = new EventType();
$form = $this->createCreateForm($entity);
@@ -52,7 +52,7 @@ class EventTypeController extends AbstractController
* Deletes a EventType entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/event_type/{id}/delete', name: 'chill_eventtype_admin_delete', methods: ['POST', 'DELETE'])]
public function deleteAction(Request $request, mixed $id)
public function deleteAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse
{
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
@@ -76,7 +76,7 @@ class EventTypeController extends AbstractController
* Displays a form to edit an existing EventType entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/event_type/{id}/edit', name: 'chill_eventtype_admin_edit')]
public function editAction(mixed $id)
public function editAction(mixed $id): \Symfony\Component\HttpFoundation\Response
{
$em = $this->managerRegistry->getManager();
@@ -100,7 +100,7 @@ class EventTypeController extends AbstractController
* Lists all EventType entities.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/event_type/', name: 'chill_eventtype_admin', options: [null])]
public function indexAction()
public function indexAction(): \Symfony\Component\HttpFoundation\Response
{
$em = $this->managerRegistry->getManager();
@@ -115,7 +115,7 @@ class EventTypeController extends AbstractController
* Displays a form to create a new EventType entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/event_type/new', name: 'chill_eventtype_admin_new')]
public function newAction()
public function newAction(): \Symfony\Component\HttpFoundation\Response
{
$entity = new EventType();
$form = $this->createCreateForm($entity);
@@ -130,7 +130,7 @@ class EventTypeController extends AbstractController
* Finds and displays a EventType entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/event_type/{id}/show', name: 'chill_eventtype_admin_show')]
public function showAction(mixed $id)
public function showAction(mixed $id): \Symfony\Component\HttpFoundation\Response
{
$em = $this->managerRegistry->getManager();
@@ -152,7 +152,7 @@ class EventTypeController extends AbstractController
* Edits an existing EventType entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/event_type/{id}/update', name: 'chill_eventtype_admin_update', methods: ['POST', 'PUT'])]
public function updateAction(Request $request, mixed $id)
public function updateAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
$em = $this->managerRegistry->getManager();
@@ -203,7 +203,7 @@ class EventTypeController extends AbstractController
*
* @return \Symfony\Component\Form\FormInterface The form
*/
private function createDeleteForm(mixed $id)
private function createDeleteForm(mixed $id): \Symfony\Component\Form\FormInterface
{
return $this->createFormBuilder()
->setAction($this->generateUrl(

View File

@@ -453,7 +453,7 @@ final class ParticipationController extends AbstractController
}
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/participation/{event_id}/update_multiple', name: 'chill_event_participation_update_multiple', methods: ['POST'])]
public function updateMultipleAction(mixed $event_id, Request $request)
public function updateMultipleAction(mixed $event_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
/** @var Event $event */
$event = $this->managerRegistry->getRepository(Event::class)
@@ -689,7 +689,7 @@ final class ParticipationController extends AbstractController
*
* @return Response
*/
protected function newSingle(Request $request)
protected function newSingle(Request $request): \Symfony\Component\HttpFoundation\Response
{
$returnPath = $request->query->has('return_path') ?
$request->query->get('return_path') : null;
@@ -720,7 +720,7 @@ final class ParticipationController extends AbstractController
*
* @throws \RuntimeException if an error is detected
*/
protected function testRequest(Request $request)
protected function testRequest(Request $request): void
{
$single = $request->query->has('person_id');
$multiple = $request->query->has('persons_ids');
@@ -747,7 +747,7 @@ final class ParticipationController extends AbstractController
/**
* @return FormInterface
*/
private function createDeleteForm($participation_id)
private function createDeleteForm($participation_id): \Symfony\Component\Form\FormInterface
{
return $this->createFormBuilder()
->setAction($this->generateUrl('chill_event_participation_delete', [

View File

@@ -28,7 +28,7 @@ class RoleController extends AbstractController
* Creates a new Role entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/role/create', name: 'chill_event_admin_role_create', methods: ['POST'])]
public function createAction(Request $request)
public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
$entity = new Role();
$form = $this->createCreateForm($entity);
@@ -52,7 +52,7 @@ class RoleController extends AbstractController
* Deletes a Role entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/role/{id}/delete', name: 'chill_event_admin_role_delete', methods: ['POST', 'DELETE'])]
public function deleteAction(Request $request, mixed $id)
public function deleteAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse
{
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
@@ -76,7 +76,7 @@ class RoleController extends AbstractController
* Displays a form to edit an existing Role entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/role/{id}/edit', name: 'chill_event_admin_role_edit')]
public function editAction(mixed $id)
public function editAction(mixed $id): \Symfony\Component\HttpFoundation\Response
{
$em = $this->managerRegistry->getManager();
@@ -100,7 +100,7 @@ class RoleController extends AbstractController
* Lists all Role entities.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/role/', name: 'chill_event_admin_role', options: [null])]
public function indexAction()
public function indexAction(): \Symfony\Component\HttpFoundation\Response
{
$em = $this->managerRegistry->getManager();
@@ -115,7 +115,7 @@ class RoleController extends AbstractController
* Displays a form to create a new Role entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/role/new', name: 'chill_event_admin_role_new')]
public function newAction()
public function newAction(): \Symfony\Component\HttpFoundation\Response
{
$entity = new Role();
$form = $this->createCreateForm($entity);
@@ -130,7 +130,7 @@ class RoleController extends AbstractController
* Finds and displays a Role entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/role/{id}/show', name: 'chill_event_admin_role_show')]
public function showAction(mixed $id)
public function showAction(mixed $id): \Symfony\Component\HttpFoundation\Response
{
$em = $this->managerRegistry->getManager();
@@ -152,7 +152,7 @@ class RoleController extends AbstractController
* Edits an existing Role entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/role/{id}/update', name: 'chill_event_admin_role_update', methods: ['POST', 'PUT'])]
public function updateAction(Request $request, mixed $id)
public function updateAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
$em = $this->managerRegistry->getManager();
@@ -203,7 +203,7 @@ class RoleController extends AbstractController
*
* @return \Symfony\Component\Form\FormInterface The form
*/
private function createDeleteForm(mixed $id)
private function createDeleteForm(mixed $id): \Symfony\Component\Form\FormInterface
{
return $this->createFormBuilder()
->setAction($this->generateUrl('chill_event_admin_role_delete', ['id' => $id]))

View File

@@ -28,7 +28,7 @@ class StatusController extends AbstractController
* Creates a new Status entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/status/create', name: 'chill_event_admin_status_create', methods: ['POST'])]
public function createAction(Request $request)
public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
$entity = new Status();
$form = $this->createCreateForm($entity);
@@ -52,7 +52,7 @@ class StatusController extends AbstractController
* Deletes a Status entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/status/{id}/delete', name: 'chill_event_admin_status_delete', methods: ['POST', 'DELETE'])]
public function deleteAction(Request $request, mixed $id)
public function deleteAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse
{
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
@@ -76,7 +76,7 @@ class StatusController extends AbstractController
* Displays a form to edit an existing Status entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/status/{id}/edit', name: 'chill_event_admin_status_edit')]
public function editAction(mixed $id)
public function editAction(mixed $id): \Symfony\Component\HttpFoundation\Response
{
$em = $this->managerRegistry->getManager();
@@ -100,7 +100,7 @@ class StatusController extends AbstractController
* Lists all Status entities.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/status/', name: 'chill_event_admin_status', options: [null])]
public function indexAction()
public function indexAction(): \Symfony\Component\HttpFoundation\Response
{
$em = $this->managerRegistry->getManager();
@@ -115,7 +115,7 @@ class StatusController extends AbstractController
* Displays a form to create a new Status entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/status/new', name: 'chill_event_admin_status_new')]
public function newAction()
public function newAction(): \Symfony\Component\HttpFoundation\Response
{
$entity = new Status();
$form = $this->createCreateForm($entity);
@@ -130,7 +130,7 @@ class StatusController extends AbstractController
* Finds and displays a Status entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/status/{id}/show', name: 'chill_event_admin_status_show')]
public function showAction(mixed $id)
public function showAction(mixed $id): \Symfony\Component\HttpFoundation\Response
{
$em = $this->managerRegistry->getManager();
@@ -152,7 +152,7 @@ class StatusController extends AbstractController
* Edits an existing Status entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/status/{id}/update', name: 'chill_event_admin_status_update', methods: ['POST', 'PUT'])]
public function updateAction(Request $request, mixed $id)
public function updateAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
$em = $this->managerRegistry->getManager();
@@ -203,7 +203,7 @@ class StatusController extends AbstractController
*
* @return \Symfony\Component\Form\FormInterface The form
*/
private function createDeleteForm(mixed $id)
private function createDeleteForm(mixed $id): \Symfony\Component\Form\FormInterface
{
return $this->createFormBuilder()
->setAction($this->generateUrl('chill_event_admin_status_delete', ['id' => $id]))

View File

@@ -26,7 +26,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
*/
class ChillEventExtension extends Extension implements PrependExtensionInterface
{
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
@@ -45,7 +45,7 @@ class ChillEventExtension extends Extension implements PrependExtensionInterface
/** (non-PHPdoc).
* @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend()
*/
public function prepend(ContainerBuilder $container)
public function prepend(ContainerBuilder $container): void
{
$this->prependAuthorization($container);
$this->prependRoute($container);

View File

@@ -129,7 +129,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
/**
* @return Center
*/
public function getCenter()
public function getCenter(): ?\Chill\MainBundle\Entity\Center
{
return $this->center;
}
@@ -137,7 +137,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
/**
* @return Scope
*/
public function getCircle()
public function getCircle(): ?\Chill\MainBundle\Entity\Scope
{
return $this->circle;
}
@@ -147,7 +147,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
*
* @return \DateTime
*/
public function getDate()
public function getDate(): ?\DateTime
{
return $this->date;
}
@@ -157,7 +157,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
*
* @return int
*/
public function getId()
public function getId(): ?int
{
return $this->id;
}
@@ -172,7 +172,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
*
* @return string
*/
public function getName()
public function getName(): ?string
{
return $this->name;
}
@@ -202,7 +202,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
*
* @return Scope
*/
public function getScope()
public function getScope(): ?\Chill\MainBundle\Entity\Scope
{
return $this->getCircle();
}
@@ -210,7 +210,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
/**
* @return EventType
*/
public function getType()
public function getType(): ?\Chill\EventBundle\Entity\EventType
{
return $this->type;
}
@@ -218,7 +218,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
/**
* Remove participation.
*/
public function removeParticipation(Participation $participation)
public function removeParticipation(Participation $participation): void
{
$this->participations->removeElement($participation);
}

View File

@@ -87,7 +87,7 @@ class EventType
*
* @return bool
*/
public function getActive()
public function getActive(): bool
{
return $this->active;
}
@@ -97,7 +97,7 @@ class EventType
*
* @return int
*/
public function getId()
public function getId(): ?int
{
return $this->id;
}
@@ -112,7 +112,7 @@ class EventType
return $this->name;
}
public function getRoles()
public function getRoles(): \Doctrine\Common\Collections\Collection
{
return $this->roles;
}
@@ -122,7 +122,7 @@ class EventType
*
* @return Collection
*/
public function getStatuses()
public function getStatuses(): \Doctrine\Common\Collections\Collection
{
return $this->statuses;
}
@@ -130,7 +130,7 @@ class EventType
/**
* Remove role.
*/
public function removeRole(Role $role)
public function removeRole(Role $role): void
{
$this->roles->removeElement($role);
}
@@ -138,7 +138,7 @@ class EventType
/**
* Remove status.
*/
public function removeStatus(Status $status)
public function removeStatus(Status $status): void
{
$this->statuses->removeElement($status);
}

View File

@@ -58,7 +58,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa
#[ORM\ManyToOne(targetEntity: Status::class)]
private ?Status $status = null;
public function getCenter()
public function getCenter(): ?\Chill\MainBundle\Entity\Center
{
if (null === $this->getEvent()) {
throw new \RuntimeException('The event is not linked with this instance. You should initialize the event with a valid center before.');
@@ -88,7 +88,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa
*
* @return \DateTimeInterface|null
*/
public function getLastUpdate()
public function getLastUpdate(): ?\DateTimeInterface
{
return $this->getUpdatedAt();
}
@@ -98,7 +98,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa
*
* @return Person
*/
public function getPerson()
public function getPerson(): ?\Chill\PersonBundle\Entity\Person
{
return $this->person;
}
@@ -114,7 +114,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa
/**
* @return Scope
*/
public function getScope()
public function getScope(): ?\Chill\MainBundle\Entity\Scope
{
if (null === $this->getEvent()) {
throw new \RuntimeException('The event is not linked with this instance. You should initialize the event with a valid center before.');
@@ -137,7 +137,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa
* - the role can be associated with this event type
* - the status can be associated with this event type
*/
public function isConsistent(ExecutionContextInterface $context)
public function isConsistent(ExecutionContextInterface $context): void
{
if (null === $this->getEvent() || null === $this->getRole() || null === $this->getStatus()) {
return;

View File

@@ -43,7 +43,7 @@ class Role
*
* @return bool
*/
public function getActive()
public function getActive(): bool
{
return $this->active;
}
@@ -53,7 +53,7 @@ class Role
*
* @return int
*/
public function getId()
public function getId(): ?int
{
return $this->id;
}
@@ -73,7 +73,7 @@ class Role
*
* @return EventType
*/
public function getType()
public function getType(): ?\Chill\EventBundle\Entity\EventType
{
return $this->type;
}

View File

@@ -45,7 +45,7 @@ class Status
*
* @return bool
*/
public function getActive()
public function getActive(): bool
{
return $this->active;
}
@@ -55,7 +55,7 @@ class Status
*
* @return int
*/
public function getId()
public function getId(): ?int
{
return $this->id;
}
@@ -75,7 +75,7 @@ class Status
*
* @return EventType
*/
public function getType()
public function getType(): ?\Chill\EventBundle\Entity\EventType
{
return $this->type;
}

View File

@@ -32,7 +32,7 @@ class EventDateAggregator implements AggregatorInterface
return null;
}
public function alterQuery(QueryBuilder $qb, $data)
public function alterQuery(QueryBuilder $qb, $data): void
{
$order = null;
@@ -67,7 +67,7 @@ class EventDateAggregator implements AggregatorInterface
return Declarations::EVENT;
}
public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder): void
{
$builder->add('frequency', ChoiceType::class, [
'choices' => self::CHOICES,

View File

@@ -29,7 +29,7 @@ class EventTypeAggregator implements AggregatorInterface
return null;
}
public function alterQuery(QueryBuilder $qb, $data)
public function alterQuery(QueryBuilder $qb, $data): void
{
if (!\in_array('eventtype', $qb->getAllAliases(), true)) {
$qb->leftJoin('event.type', 'eventtype');
@@ -44,7 +44,7 @@ class EventTypeAggregator implements AggregatorInterface
return Declarations::EVENT;
}
public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder): void
{
// no form required for this aggregator
}

View File

@@ -29,7 +29,7 @@ class RoleAggregator implements AggregatorInterface
return null;
}
public function alterQuery(QueryBuilder $qb, $data)
public function alterQuery(QueryBuilder $qb, $data): void
{
if (!\in_array('event_part', $qb->getAllAliases(), true)) {
$qb->leftJoin('event_part.role', 'role');
@@ -44,7 +44,7 @@ class RoleAggregator implements AggregatorInterface
return Declarations::EVENT_PARTICIPANTS;
}
public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder): void
{
// no form required for this aggregator
}

View File

@@ -30,7 +30,7 @@ class EventDateFilter implements FilterInterface
return null;
}
public function alterQuery(QueryBuilder $qb, $data)
public function alterQuery(QueryBuilder $qb, $data): void
{
$where = $qb->getDQLPart('where');
$clause = $qb->expr()->between(
@@ -61,7 +61,7 @@ class EventDateFilter implements FilterInterface
return Declarations::EVENT;
}
public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder): void
{
$builder
->add('date_from', PickRollingDateType::class, [

View File

@@ -34,7 +34,7 @@ class EventTypeFilter implements ExportElementValidatedInterface, FilterInterfac
return null;
}
public function alterQuery(QueryBuilder $qb, $data)
public function alterQuery(QueryBuilder $qb, $data): void
{
$clause = $qb->expr()->in('event.type', ':selected_event_types');
@@ -47,7 +47,7 @@ class EventTypeFilter implements ExportElementValidatedInterface, FilterInterfac
return Declarations::EVENT;
}
public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder): void
{
$builder->add('types', EntityType::class, [
'choices' => $this->eventTypeRepository->findAllActive(),
@@ -83,7 +83,7 @@ class EventTypeFilter implements ExportElementValidatedInterface, FilterInterfac
return 'Filtered by event type';
}
public function validateForm($data, ExecutionContextInterface $context)
public function validateForm($data, ExecutionContextInterface $context): void
{
if (null === $data['types'] || 0 === \count($data['types'])) {
$context

View File

@@ -34,7 +34,7 @@ class RoleFilter implements ExportElementValidatedInterface, FilterInterface
return null;
}
public function alterQuery(QueryBuilder $qb, $data)
public function alterQuery(QueryBuilder $qb, $data): void
{
$clause = $qb->expr()->in('event_part.role', ':selected_part_roles');
@@ -47,7 +47,7 @@ class RoleFilter implements ExportElementValidatedInterface, FilterInterface
return Declarations::EVENT_PARTICIPANTS;
}
public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder): void
{
$builder->add('part_roles', EntityType::class, [
'choices' => $this->roleRepository->findAllActive(),
@@ -83,7 +83,7 @@ class RoleFilter implements ExportElementValidatedInterface, FilterInterface
return 'Filter by participant roles';
}
public function validateForm($data, ExecutionContextInterface $context)
public function validateForm($data, ExecutionContextInterface $context): void
{
if (null === $data['part_roles'] || 0 === \count($data['part_roles'])) {
$context

View File

@@ -63,7 +63,7 @@ class EventChoiceLoader implements ChoiceLoaderInterface
*
* @return array
*/
public function loadChoicesForValues(array $values, $value = null)
public function loadChoicesForValues(array $values, $value = null): array
{
$choices = [];
@@ -92,7 +92,7 @@ class EventChoiceLoader implements ChoiceLoaderInterface
*
* @return array|string[]
*/
public function loadValuesForChoices(array $choices, $value = null)
public function loadValuesForChoices(array $choices, $value = null): array
{
$values = [];

View File

@@ -30,7 +30,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class EventType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name', TextType::class, [
@@ -76,7 +76,7 @@ class EventType extends AbstractType
]);
}
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Event::class,
@@ -90,7 +90,7 @@ class EventType extends AbstractType
/**
* @return string
*/
public function getBlockPrefix()
public function getBlockPrefix(): string
{
return 'chill_eventbundle_event';
}

View File

@@ -17,7 +17,7 @@ use Symfony\Component\Form\FormBuilderInterface;
class EventTypeType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name', TranslatableStringFormType::class)
@@ -27,12 +27,12 @@ class EventTypeType extends AbstractType
/**
* @return string
*/
public function getBlockPrefix()
public function getBlockPrefix(): string
{
return 'chill_eventbundle_eventtype';
}
public function configureOptions(\Symfony\Component\OptionsResolver\OptionsResolver $resolver)
public function configureOptions(\Symfony\Component\OptionsResolver\OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => \Chill\EventBundle\Entity\EventType::class,

View File

@@ -29,7 +29,7 @@ final class ParticipationType extends AbstractType
{
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
// local copy of variable for Closure
$translatableStringHelper = $this->translatableStringHelper;
@@ -45,7 +45,7 @@ final class ParticipationType extends AbstractType
]);
}
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefined('event_type')
->setAllowedTypes('event_type', ['null', EventType::class])

View File

@@ -22,7 +22,7 @@ final class RoleType extends AbstractType
{
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name', TranslatableStringFormType::class)
@@ -36,12 +36,12 @@ final class RoleType extends AbstractType
/**
* @return string
*/
public function getBlockPrefix()
public function getBlockPrefix(): string
{
return 'chill_eventbundle_role';
}
public function configureOptions(\Symfony\Component\OptionsResolver\OptionsResolver $resolver)
public function configureOptions(\Symfony\Component\OptionsResolver\OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => \Chill\EventBundle\Entity\Role::class,

View File

@@ -18,7 +18,7 @@ use Symfony\Component\Form\FormBuilderInterface;
class StatusType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name', TranslatableStringFormType::class)
@@ -29,12 +29,12 @@ class StatusType extends AbstractType
/**
* @return string
*/
public function getBlockPrefix()
public function getBlockPrefix(): string
{
return 'chill_eventbundle_status';
}
public function configureOptions(\Symfony\Component\OptionsResolver\OptionsResolver $resolver)
public function configureOptions(\Symfony\Component\OptionsResolver\OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => \Chill\EventBundle\Entity\Status::class,

View File

@@ -45,7 +45,7 @@ final class PickEventType extends AbstractType
private readonly Security $security,
) {}
public function buildView(\Symfony\Component\Form\FormView $view, \Symfony\Component\Form\FormInterface $form, array $options)
public function buildView(\Symfony\Component\Form\FormView $view, \Symfony\Component\Form\FormInterface $form, array $options): void
{
$view->vars['attr']['data-person-picker'] = true;
$view->vars['attr']['data-select-interactive-loading'] = true;
@@ -57,7 +57,7 @@ final class PickEventType extends AbstractType
$view->vars['attr']['data-searching-label'] = $this->translator->trans('select2.searching');
}
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
parent::configureOptions($resolver);

View File

@@ -33,7 +33,7 @@ class PickEventTypeType extends AbstractType
$this->translatableStringHelper = $helper;
}
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$helper = $this->translatableStringHelper;
$resolver->setDefaults(
@@ -47,7 +47,7 @@ class PickEventTypeType extends AbstractType
);
}
public function getParent()
public function getParent(): ?string
{
return EntityType::class;
}

View File

@@ -34,7 +34,7 @@ final class PickRoleType extends AbstractType
private readonly RoleRepository $roleRepository,
) {}
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
// create copy for easier management
$qb = $options['query_builder'];
@@ -69,7 +69,7 @@ final class PickRoleType extends AbstractType
}
}
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
// create copy for use in Closure
$translatableStringHelper = $this->translatableStringHelper;
@@ -100,7 +100,7 @@ final class PickRoleType extends AbstractType
]);
}
public function getParent()
public function getParent(): ?string
{
return EntityType::class;
}

View File

@@ -35,7 +35,7 @@ final class PickStatusType extends AbstractType
{
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected TranslatorInterface $translator, protected StatusRepository $statusRepository) {}
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$qb = $options['query_builder'];
@@ -66,7 +66,7 @@ final class PickStatusType extends AbstractType
}
}
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
// create copy for use in Closure
$translatableStringHelper = $this->translatableStringHelper;
@@ -97,7 +97,7 @@ final class PickStatusType extends AbstractType
]);
}
public function getParent()
public function getParent(): ?string
{
return EntityType::class;
}

View File

@@ -27,7 +27,7 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface
$this->authorizationChecker = $authorizationChecker;
}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
{
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
return;

View File

@@ -37,7 +37,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
$this->translator = $translator;
}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
{
/** @var \Chill\PersonBundle\Entity\Person $person */
$person = $parameters['person'] ?? null;

View File

@@ -24,7 +24,7 @@ final readonly class SectionMenuBuilder implements LocalMenuBuilderInterface
private TranslatorInterface $translator,
) {}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
{
if ($this->security->isGranted(EventVoter::SEE)) {
$menu->addChild(

View File

@@ -61,7 +61,7 @@ class EventSearch extends AbstractSearch
$limit = 50,
array $options = [],
$format = 'html',
) {
): string|array {
$total = $this->count($terms);
$paginator = $this->paginatorFactory->create($total);

View File

@@ -78,12 +78,12 @@ class EventVoter extends AbstractChillVoter implements ProvideRoleHierarchyInter
return [self::ROLES, self::STATS];
}
public function supports($attribute, $subject)
public function supports(string $attribute, mixed $subject): bool
{
return $this->voterHelper->supports($attribute, $subject);
}
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool
{
$this->logger->debug(sprintf('Voting from %s class', self::class));

View File

@@ -75,17 +75,12 @@ class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierar
return [self::ROLES, self::STATS];
}
public function supports($attribute, $subject)
public function supports(string $attribute, mixed $subject): bool
{
return $this->voterHelper->supports($attribute, $subject);
}
/**
* @param string $attribute
*
* @return bool
*/
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool
{
$this->logger->debug(sprintf('Voting from %s class', self::class));

View File

@@ -66,7 +66,7 @@ final class ParticipationControllerTest extends WebTestCase
*
* Those request should fail before any processing.
*/
public function testCreateActionWrongParameters()
public function testCreateActionWrongParameters(): void
{
$client = $this->getClientAuthenticated();
$this->prepareDI();
@@ -138,7 +138,7 @@ final class ParticipationControllerTest extends WebTestCase
);
}
public function testEditMultipleAction()
public function testEditMultipleAction(): void
{
$client = $this->getClientAuthenticated();
$this->prepareDI();
@@ -165,7 +165,7 @@ final class ParticipationControllerTest extends WebTestCase
->isRedirect('/fr/event/event/'.$event->getId().'/show'));
}
public function testNewActionWrongParameters()
public function testNewActionWrongParameters(): void
{
$client = $this->getClientAuthenticated();
$this->prepareDI();
@@ -237,7 +237,7 @@ final class ParticipationControllerTest extends WebTestCase
);
}
public function testNewMultipleAction()
public function testNewMultipleAction(): void
{
$client = $this->getClientAuthenticated();
$this->prepareDI();
@@ -307,7 +307,7 @@ final class ParticipationControllerTest extends WebTestCase
$this->assertEquals($nbParticipations + 2, $event->getParticipations()->count());
}
public function testNewMultipleWithAllPeopleParticipating()
public function testNewMultipleWithAllPeopleParticipating(): void
{
$client = $this->getClientAuthenticated();
$this->prepareDI();
@@ -333,7 +333,7 @@ final class ParticipationControllerTest extends WebTestCase
);
}
public function testNewMultipleWithSomePeopleParticipating()
public function testNewMultipleWithSomePeopleParticipating(): void
{
$client = $this->getClientAuthenticated();
$this->prepareDI();
@@ -409,7 +409,7 @@ final class ParticipationControllerTest extends WebTestCase
);
}
public function testNewSingleAction()
public function testNewSingleAction(): void
{
$client = $this->getClientAuthenticated();
$this->prepareDI();

View File

@@ -35,7 +35,7 @@ class EventDateFilterTest extends AbstractFilterTest
$this->rollingDateConverter = self::getContainer()->get(RollingDateConverterInterface::class);
}
public function getFilter()
public function getFilter(): \Chill\EventBundle\Export\Filter\EventDateFilter
{
return new EventDateFilter($this->rollingDateConverter);
}

View File

@@ -35,7 +35,7 @@ class RoleFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get(RoleFilter::class);
}
public function getFilter()
public function getFilter(): \Chill\EventBundle\Export\Filter\RoleFilter
{
return $this->filter;
}

View File

@@ -107,7 +107,7 @@ final class EventSearchTest extends WebTestCase
$this->events = [];
}
public function testDisplayAll()
public function testDisplayAll(): void
{
$crawler = $this->client->request('GET', '/fr/search', [
'q' => '@events',
@@ -124,7 +124,7 @@ final class EventSearchTest extends WebTestCase
* Test that a user connected with an user with the wrong center does not
* see the events.
*/
public function testDisplayAllWrongUser()
public function testDisplayAllWrongUser(): void
{
$client = self::createClient([], [
'PHP_AUTH_USER' => 'center b_social',
@@ -143,7 +143,7 @@ final class EventSearchTest extends WebTestCase
);
}
public function testSearchByDateDateBetween()
public function testSearchByDateDateBetween(): void
{
// serach with date from **and** date-to
$crawler = $this->client->request('GET', '/fr/search', [
@@ -190,7 +190,7 @@ final class EventSearchTest extends WebTestCase
});
}
public function testSearchByDateDateFromOnly()
public function testSearchByDateDateFromOnly(): void
{
// search with date from
$crawler = $this->client->request('GET', '/fr/search', [
@@ -225,7 +225,7 @@ final class EventSearchTest extends WebTestCase
});
}
public function testSearchByDateDateTo()
public function testSearchByDateDateTo(): void
{
// serach with date from **and** date-to
$crawler = $this->client->request('GET', '/fr/search', [
@@ -265,7 +265,7 @@ final class EventSearchTest extends WebTestCase
});
}
public function testSearchByDefault()
public function testSearchByDefault(): void
{
$crawler = $this->client->request('GET', '/fr/search', [
'q' => '@events printemps',
@@ -284,7 +284,7 @@ final class EventSearchTest extends WebTestCase
);
}
public function testSearchByName()
public function testSearchByName(): void
{
$crawler = $this->client->request('GET', '/fr/search', [
'q' => '@events name:printemps',
@@ -303,7 +303,7 @@ final class EventSearchTest extends WebTestCase
);
}
protected function createEvents()
protected function createEvents(): void
{
$event1 = (new Event())
->setCenter($this->centerA)

View File

@@ -138,7 +138,7 @@ class TimelineEventProvider implements TimelineProviderInterface
*
* @throws \LogicException if the context is not supported
*/
private function checkContext($context)
private function checkContext($context): void
{
if ('person' !== $context) {
throw new \LogicException("The context '{$context}' is not supported. Currently only 'person' is supported");