mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 02:23:51 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -33,23 +33,17 @@ use function count;
|
||||
*/
|
||||
class ParticipationController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @var \Psr\Log\LoggerInterface
|
||||
*/
|
||||
private $logger;
|
||||
|
||||
/**
|
||||
* ParticipationController constructor.
|
||||
*/
|
||||
public function __construct(LoggerInterface $logger)
|
||||
public function __construct(private LoggerInterface $logger)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
*/
|
||||
public function createAction(Request $request)
|
||||
public function createAction(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
{
|
||||
// test the request is correct
|
||||
try {
|
||||
@@ -167,7 +161,7 @@ class ParticipationController extends AbstractController
|
||||
/**
|
||||
* @return Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
*/
|
||||
public function createMultiple(Request $request)
|
||||
public function createMultiple(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
{
|
||||
$participations = $this->handleRequest($request, new Participation(), true);
|
||||
|
||||
@@ -210,7 +204,7 @@ class ParticipationController extends AbstractController
|
||||
/**
|
||||
* @return Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
*/
|
||||
public function createSingle(Request $request)
|
||||
public function createSingle(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
{
|
||||
$participation = $this->handleRequest($request, new Participation(), false);
|
||||
|
||||
@@ -253,7 +247,7 @@ class ParticipationController extends AbstractController
|
||||
*
|
||||
* @return Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
*/
|
||||
public function deleteAction($participation_id, Request $request)
|
||||
public function deleteAction($participation_id, Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$participation = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->findOneBy([
|
||||
@@ -332,7 +326,7 @@ class ParticipationController extends AbstractController
|
||||
*
|
||||
* @return Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
*/
|
||||
public function editMultipleAction($event_id)
|
||||
public function editMultipleAction($event_id): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
{
|
||||
$event = $this->getDoctrine()->getRepository(\Chill\EventBundle\Entity\Event::class)
|
||||
->find($event_id);
|
||||
@@ -389,7 +383,7 @@ class ParticipationController extends AbstractController
|
||||
*
|
||||
* @return Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
*/
|
||||
public function newAction(Request $request)
|
||||
public function newAction(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
{
|
||||
// test the request is correct
|
||||
try {
|
||||
@@ -555,7 +549,7 @@ class ParticipationController extends AbstractController
|
||||
Request $request,
|
||||
Participation $participation,
|
||||
bool $multiple = false
|
||||
) {
|
||||
): \Chill\EventBundle\Entity\Participation|array {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
if ($em->contains($participation)) {
|
||||
@@ -632,7 +626,7 @@ class ParticipationController extends AbstractController
|
||||
*
|
||||
* @return Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
*/
|
||||
protected function newMultiple(Request $request)
|
||||
protected function newMultiple(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
{
|
||||
$participations = $this->handleRequest($request, new Participation(), true);
|
||||
$ignoredParticipations = $newParticipations = [];
|
||||
|
Reference in New Issue
Block a user