mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-25 00:53:48 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -20,6 +20,7 @@ class AdminController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*
|
||||
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/document", name="chill_docstore_admin", options={null})
|
||||
*/
|
||||
public function indexAction()
|
||||
@@ -29,6 +30,7 @@ class AdminController extends AbstractController
|
||||
|
||||
/**
|
||||
* @return \Symfony\Component\HttpFoundation\RedirectResponse
|
||||
*
|
||||
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/document_redirect_to_main", name="chill_docstore_admin_redirect_to_admin_index", options={null})
|
||||
*/
|
||||
public function redirectToAdminIndexAction()
|
||||
|
@@ -13,12 +13,9 @@ namespace Chill\DocStoreBundle\Controller;
|
||||
|
||||
use Chill\DocStoreBundle\Entity\AccompanyingCourseDocument;
|
||||
use Chill\DocStoreBundle\Form\AccompanyingCourseDocumentType;
|
||||
use Chill\DocStoreBundle\Repository\AccompanyingCourseDocumentRepository;
|
||||
use Chill\DocStoreBundle\Security\Authorization\AccompanyingCourseDocumentVoter;
|
||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use DateTime;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FormType;
|
||||
@@ -85,7 +82,7 @@ class DocumentAccompanyingCourseController extends AbstractController
|
||||
$this->denyAccessUnlessGranted(AccompanyingCourseDocumentVoter::UPDATE, $document);
|
||||
|
||||
$document->setUser($this->getUser());
|
||||
$document->setDate(new DateTime('Now'));
|
||||
$document->setDate(new \DateTime('Now'));
|
||||
|
||||
$form = $this->createForm(
|
||||
AccompanyingCourseDocumentType::class,
|
||||
@@ -130,7 +127,7 @@ class DocumentAccompanyingCourseController extends AbstractController
|
||||
$document = new AccompanyingCourseDocument();
|
||||
$document->setUser($this->getUser());
|
||||
$document->setCourse($course);
|
||||
$document->setDate(new DateTime('Now'));
|
||||
$document->setDate(new \DateTime('Now'));
|
||||
|
||||
$this->denyAccessUnlessGranted(AccompanyingCourseDocumentVoter::CREATE, $document);
|
||||
|
||||
|
@@ -37,7 +37,7 @@ class DocumentCategoryController extends AbstractController
|
||||
['bundleId' => $bundleId, 'idInsideBundle' => $idInsideBundle]
|
||||
);
|
||||
|
||||
if ($this->isCsrfTokenValid('delete' . $bundleId . $idInsideBundle, $request->request->get('_token'))) {
|
||||
if ($this->isCsrfTokenValid('delete'.$bundleId.$idInsideBundle, $request->request->get('_token'))) {
|
||||
$em->remove($documentCategory);
|
||||
$em->flush();
|
||||
}
|
||||
|
@@ -13,14 +13,11 @@ namespace Chill\DocStoreBundle\Controller;
|
||||
|
||||
use Chill\DocStoreBundle\Entity\PersonDocument;
|
||||
use Chill\DocStoreBundle\Form\PersonDocumentType;
|
||||
use Chill\DocStoreBundle\Repository\PersonDocumentACLAwareRepositoryInterface;
|
||||
use Chill\DocStoreBundle\Security\Authorization\PersonDocumentVoter;
|
||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Privacy\PrivacyEvent;
|
||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
use DateTime;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FormType;
|
||||
@@ -92,7 +89,7 @@ class DocumentPersonController extends AbstractController
|
||||
$this->denyAccessUnlessGranted('CHILL_PERSON_DOCUMENT_UPDATE', $document);
|
||||
|
||||
$document->setUser($this->getUser());
|
||||
$document->setDate(new DateTime('Now'));
|
||||
$document->setDate(new \DateTime('Now'));
|
||||
|
||||
$form = $this->createForm(
|
||||
PersonDocumentType::class,
|
||||
@@ -156,7 +153,7 @@ class DocumentPersonController extends AbstractController
|
||||
$document = new PersonDocument();
|
||||
$document->setUser($this->getUser());
|
||||
$document->setPerson($person);
|
||||
$document->setDate(new DateTime('Now'));
|
||||
$document->setDate(new \DateTime('Now'));
|
||||
|
||||
$form = $this->createForm(PersonDocumentType::class, $document, [
|
||||
'role' => 'CHILL_PERSON_DOCUMENT_CREATE',
|
||||
|
@@ -16,12 +16,10 @@ use Chill\DocStoreBundle\Security\Authorization\AccompanyingCourseDocumentVoter;
|
||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||
use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactory;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Symfony\Bundle\TwigBundle\TwigEngine;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Templating\EngineInterface;
|
||||
|
||||
final readonly class GenericDocForAccompanyingPeriodController
|
||||
{
|
||||
@@ -41,7 +39,7 @@ final readonly class GenericDocForAccompanyingPeriodController
|
||||
public function list(AccompanyingPeriod $accompanyingPeriod): Response
|
||||
{
|
||||
if (!$this->security->isGranted(AccompanyingCourseDocumentVoter::SEE, $accompanyingPeriod)) {
|
||||
throw new AccessDeniedHttpException("not allowed to see the documents for accompanying period");
|
||||
throw new AccessDeniedHttpException('not allowed to see the documents for accompanying period');
|
||||
}
|
||||
|
||||
$filterBuilder = $this->filterOrderHelperFactory
|
||||
@@ -51,7 +49,7 @@ final readonly class GenericDocForAccompanyingPeriodController
|
||||
|
||||
if ([] !== $places = $this->manager->placesForAccompanyingPeriod($accompanyingPeriod)) {
|
||||
$filterBuilder->addCheckbox('places', $places, [], array_map(
|
||||
static fn (string $k) => 'generic_doc.filter.keys.' . $k,
|
||||
static fn (string $k) => 'generic_doc.filter.keys.'.$k,
|
||||
$places
|
||||
));
|
||||
}
|
||||
@@ -59,7 +57,7 @@ final readonly class GenericDocForAccompanyingPeriodController
|
||||
$filter = $filterBuilder
|
||||
->build();
|
||||
|
||||
['to' => $endDate, 'from' => $startDate ] = $filter->getDateRangeData('dateRange');
|
||||
['to' => $endDate, 'from' => $startDate] = $filter->getDateRangeData('dateRange');
|
||||
$content = $filter->getQueryString();
|
||||
|
||||
$nb = $this->manager->countDocForAccompanyingPeriod(
|
||||
|
@@ -20,7 +20,6 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Templating\EngineInterface;
|
||||
|
||||
final readonly class GenericDocForPerson
|
||||
{
|
||||
@@ -40,7 +39,7 @@ final readonly class GenericDocForPerson
|
||||
public function list(Person $person): Response
|
||||
{
|
||||
if (!$this->security->isGranted(PersonDocumentVoter::SEE, $person)) {
|
||||
throw new AccessDeniedHttpException("not allowed to see the documents for person");
|
||||
throw new AccessDeniedHttpException('not allowed to see the documents for person');
|
||||
}
|
||||
|
||||
$filterBuilder = $this->filterOrderHelperFactory
|
||||
@@ -50,7 +49,7 @@ final readonly class GenericDocForPerson
|
||||
|
||||
if ([] !== $places = $this->manager->placesForPerson($person)) {
|
||||
$filterBuilder->addCheckbox('places', $places, [], array_map(
|
||||
static fn (string $k) => 'generic_doc.filter.keys.' . $k,
|
||||
static fn (string $k) => 'generic_doc.filter.keys.'.$k,
|
||||
$places
|
||||
));
|
||||
}
|
||||
@@ -58,7 +57,7 @@ final readonly class GenericDocForPerson
|
||||
$filter = $filterBuilder
|
||||
->build();
|
||||
|
||||
['to' => $endDate, 'from' => $startDate ] = $filter->getDateRangeData('dateRange');
|
||||
['to' => $endDate, 'from' => $startDate] = $filter->getDateRangeData('dateRange');
|
||||
$content = $filter->getQueryString();
|
||||
|
||||
$nb = $this->manager->countDocForPerson(
|
||||
|
Reference in New Issue
Block a user