php cs fixes after updating php cs fixer

This commit is contained in:
2024-01-10 10:31:25 +01:00
parent 60ede58af0
commit 3c8e59e088
682 changed files with 2097 additions and 882 deletions

View File

@@ -13,4 +13,6 @@ namespace Chill\EventBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillEventBundle extends Bundle {}
class ChillEventBundle extends Bundle
{
}

View File

@@ -92,7 +92,7 @@ class EventController extends AbstractController
public function deleteAction($event_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
$em = $this->getDoctrine()->getManager();
$event = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->findOneBy([
$event = $em->getRepository(Event::class)->findOneBy([
'id' => $event_id,
]);
@@ -146,7 +146,7 @@ class EventController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event_id);
$entity = $em->getRepository(Event::class)->find($event_id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Event entity.');
@@ -173,7 +173,7 @@ class EventController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id);
$person = $em->getRepository(Person::class)->find($person_id);
if (null === $person) {
throw $this->createNotFoundException('Person not found');
@@ -187,11 +187,11 @@ class EventController extends AbstractController
$person->getCenter()
);
$total = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->countByPerson($person_id);
$total = $em->getRepository(Participation::class)->countByPerson($person_id);
$paginator = $this->paginator->create($total);
$participations = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->findByPersonInCircle(
$participations = $em->getRepository(Participation::class)->findByPersonInCircle(
$person_id,
$reachablesCircles,
$paginator->getCurrentPage()->getFirstItemNumber(),
@@ -352,7 +352,7 @@ class EventController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event_id);
$entity = $em->getRepository(Event::class)->find($event_id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Event entity.');

View File

@@ -59,7 +59,7 @@ class EventTypeController extends AbstractController
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id);
$entity = $em->getRepository(EventType::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find EventType entity.');
@@ -81,7 +81,7 @@ class EventTypeController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id);
$entity = $em->getRepository(EventType::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find EventType entity.');
@@ -106,7 +106,7 @@ class EventTypeController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->findAll();
$entities = $em->getRepository(EventType::class)->findAll();
return $this->render('@ChillEvent/EventType/index.html.twig', [
'entities' => $entities,
@@ -138,7 +138,7 @@ class EventTypeController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id);
$entity = $em->getRepository(EventType::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find EventType entity.');
@@ -161,7 +161,7 @@ class EventTypeController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id);
$entity = $em->getRepository(EventType::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find EventType entity.');

View File

@@ -33,7 +33,9 @@ class ParticipationController extends AbstractController
/**
* ParticipationController constructor.
*/
public function __construct(private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator) {}
public function __construct(private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator)
{
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/event/participation/create", name="chill_event_participation_create")
@@ -239,7 +241,7 @@ class ParticipationController extends AbstractController
public function deleteAction($participation_id, Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse
{
$em = $this->getDoctrine()->getManager();
$participation = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->findOneBy([
$participation = $em->getRepository(Participation::class)->findOneBy([
'id' => $participation_id,
]);
@@ -319,7 +321,7 @@ class ParticipationController extends AbstractController
*/
public function editMultipleAction($event_id): Response|\Symfony\Component\HttpFoundation\RedirectResponse
{
$event = $this->getDoctrine()->getRepository(\Chill\EventBundle\Entity\Event::class)
$event = $this->getDoctrine()->getRepository(Event::class)
->find($event_id);
if (null === $event) {
@@ -455,8 +457,8 @@ class ParticipationController extends AbstractController
*/
public function updateMultipleAction(mixed $event_id, Request $request)
{
/** @var \Chill\EventBundle\Entity\Event $event */
$event = $this->getDoctrine()->getRepository(\Chill\EventBundle\Entity\Event::class)
/** @var Event $event */
$event = $this->getDoctrine()->getRepository(Event::class)
->find($event_id);
if (null === $event) {
@@ -498,7 +500,7 @@ class ParticipationController extends AbstractController
}
/**
* @return \Symfony\Component\Form\FormInterface
* @return FormInterface
*/
protected function createEditFormMultiple(Collection $participations, Event $event)
{
@@ -557,7 +559,7 @@ class ParticipationController extends AbstractController
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
if (null !== $event_id) {
$event = $em->getRepository(\Chill\EventBundle\Entity\Event::class)
$event = $em->getRepository(Event::class)
->find($event_id);
if (null === $event) {
@@ -751,7 +753,7 @@ class ParticipationController extends AbstractController
}
/**
* @return \Symfony\Component\Form\FormInterface
* @return FormInterface
*/
private function createDeleteForm($participation_id)
{

View File

@@ -59,7 +59,7 @@ class RoleController extends AbstractController
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id);
$entity = $em->getRepository(Role::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Role entity.');
@@ -81,7 +81,7 @@ class RoleController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id);
$entity = $em->getRepository(Role::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Role entity.');
@@ -106,7 +106,7 @@ class RoleController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->findAll();
$entities = $em->getRepository(Role::class)->findAll();
return $this->render('@ChillEvent/Role/index.html.twig', [
'entities' => $entities,
@@ -138,7 +138,7 @@ class RoleController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id);
$entity = $em->getRepository(Role::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Role entity.');
@@ -161,7 +161,7 @@ class RoleController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id);
$entity = $em->getRepository(Role::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Role entity.');

View File

@@ -59,7 +59,7 @@ class StatusController extends AbstractController
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id);
$entity = $em->getRepository(Status::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Status entity.');
@@ -81,7 +81,7 @@ class StatusController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id);
$entity = $em->getRepository(Status::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Status entity.');
@@ -106,7 +106,7 @@ class StatusController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->findAll();
$entities = $em->getRepository(Status::class)->findAll();
return $this->render('@ChillEvent/Status/index.html.twig', [
'entities' => $entities,
@@ -138,7 +138,7 @@ class StatusController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id);
$entity = $em->getRepository(Status::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Status entity.');
@@ -161,7 +161,7 @@ class StatusController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id);
$entity = $em->getRepository(Status::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Status entity.');

View File

@@ -73,7 +73,7 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa
->findBy(['center' => $center]);
$events = $this->createEvents($center, $manager);
/** @var \Chill\PersonBundle\Entity\Person $person */
/** @var Person $person */
foreach ($people as $person) {
$nb = random_int(0, 3);

View File

@@ -27,7 +27,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
*/
final class ParticipationType extends AbstractType
{
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface;
final class RoleType extends AbstractType
{
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -43,7 +43,8 @@ final class PickEventType extends AbstractType
private readonly UrlGeneratorInterface $urlGenerator,
private readonly TranslatorInterface $translator,
private readonly Security $security
) {}
) {
}
public function buildView(\Symfony\Component\Form\FormView $view, \Symfony\Component\Form\FormInterface $form, array $options)
{

View File

@@ -32,7 +32,8 @@ final class PickRoleType extends AbstractType
private readonly TranslatableStringHelperInterface $translatableStringHelper,
private readonly TranslatorInterface $translator,
private readonly RoleRepository $roleRepository
) {}
) {
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -33,7 +33,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
*/
final class PickStatusType extends AbstractType
{
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected TranslatorInterface $translator, protected StatusRepository $statusRepository) {}
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected TranslatorInterface $translator, protected StatusRepository $statusRepository)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -43,7 +43,8 @@ class EventSearch extends AbstractSearch
private readonly AuthorizationHelper $authorizationHelper,
private readonly \Twig\Environment $templating,
private readonly PaginatorFactory $paginatorFactory
) {}
) {
}
public function getOrder()
{

View File

@@ -52,7 +52,7 @@ final class EventSearchTest extends WebTestCase
/**
* The eventSearch service, which is used to search events.
*
* @var \Chill\EventBundle\Search\EventSearch
* @var EventSearch
*/
protected $eventSearch;