mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-01-14 13:21:25 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -22,14 +22,12 @@ use Chill\CalendarBundle\RemoteCalendar\Connector\RemoteCalendarConnectorInterfa
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||
use Chill\MainBundle\Serializer\Model\Collection;
|
||||
use DateTimeImmutable;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Serializer\SerializerInterface;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Contains method to get events (Calendar) from remote calendar.
|
||||
@@ -47,8 +45,8 @@ class RemoteCalendarProxyController
|
||||
throw new BadRequestHttpException('You must provide a dateFrom parameter');
|
||||
}
|
||||
|
||||
if (false === $dateFrom = DateTimeImmutable::createFromFormat(
|
||||
DateTimeImmutable::ATOM,
|
||||
if (false === $dateFrom = \DateTimeImmutable::createFromFormat(
|
||||
\DateTimeImmutable::ATOM,
|
||||
$request->query->get('dateFrom')
|
||||
)) {
|
||||
throw new BadRequestHttpException('dateFrom not parsable');
|
||||
@@ -58,8 +56,8 @@ class RemoteCalendarProxyController
|
||||
throw new BadRequestHttpException('You must provide a dateTo parameter');
|
||||
}
|
||||
|
||||
if (false === $dateTo = DateTimeImmutable::createFromFormat(
|
||||
DateTimeImmutable::ATOM,
|
||||
if (false === $dateTo = \DateTimeImmutable::createFromFormat(
|
||||
\DateTimeImmutable::ATOM,
|
||||
$request->query->get('dateTo')
|
||||
)) {
|
||||
throw new BadRequestHttpException('dateTo not parsable');
|
||||
@@ -87,8 +85,8 @@ class RemoteCalendarProxyController
|
||||
|
||||
// in some case, we cannot paginate: we have to fetch all the items at once. We must avoid
|
||||
// further requests by forcing the number of items returned.
|
||||
if (count($events) > $paginator->getItemsPerPage()) {
|
||||
$paginator->setItemsPerPage(count($events));
|
||||
if (\count($events) > $paginator->getItemsPerPage()) {
|
||||
$paginator->setItemsPerPage(\count($events));
|
||||
}
|
||||
|
||||
$collection = new Collection($events, $paginator);
|
||||
|
||||
Reference in New Issue
Block a user