mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-12-12 13:23:15 +00:00
Rector changes and immplementations of required methods
This commit is contained in:
@@ -21,7 +21,7 @@ use Symfony\Component\DependencyInjection\Definition;
|
||||
|
||||
class CRUDControllerCompilerPass implements CompilerPassInterface
|
||||
{
|
||||
public function process(ContainerBuilder $container)
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
$crudConfig = $container->getParameter('chill_main_crud_route_loader_config');
|
||||
$apiConfig = $container->getParameter('chill_main_api_route_loader_config');
|
||||
|
||||
@@ -695,7 +695,7 @@ class CRUDController extends AbstractController
|
||||
/**
|
||||
* @return \Chill\MainBundle\Entity\Center[]
|
||||
*/
|
||||
protected function getReachableCenters(string $role, ?Scope $scope = null)
|
||||
protected function getReachableCenters(string $role, ?Scope $scope = null): array
|
||||
{
|
||||
return $this->getAuthorizationHelper()
|
||||
->getReachableCenters($this->getUser(), $role, $scope);
|
||||
|
||||
@@ -94,7 +94,7 @@ class Resolver
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasAction($crudName, $action)
|
||||
public function hasAction($crudName, $action): bool
|
||||
{
|
||||
return \array_key_exists(
|
||||
$action,
|
||||
|
||||
@@ -39,7 +39,7 @@ class CRUDRoutesLoader extends Loader
|
||||
*
|
||||
* @param mixed|null $type
|
||||
*/
|
||||
public function load($resource, $type = null): RouteCollection
|
||||
public function load(mixed $resource, $type = null): RouteCollection
|
||||
{
|
||||
if (true === $this->isLoaded) {
|
||||
throw new \RuntimeException('Do not add the "CRUD" loader twice');
|
||||
|
||||
@@ -36,7 +36,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class ChillMainBundle extends Bundle
|
||||
{
|
||||
public function build(ContainerBuilder $container)
|
||||
public function build(ContainerBuilder $container): void
|
||||
{
|
||||
parent::build($container);
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ use Symfony\Component\Console\Question\ConfirmationQuestion;
|
||||
use Symfony\Component\Validator\ConstraintViolationListInterface;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand]
|
||||
class ChillImportUsersCommand extends Command
|
||||
{
|
||||
protected static $defaultDescription = 'Import users from csv file';
|
||||
@@ -71,7 +72,7 @@ class ChillImportUsersCommand extends Command
|
||||
]);
|
||||
}
|
||||
|
||||
protected function concatenateViolations(ConstraintViolationListInterface $list)
|
||||
protected function concatenateViolations(ConstraintViolationListInterface $list): string
|
||||
{
|
||||
$str = [];
|
||||
|
||||
@@ -122,7 +123,7 @@ class ChillImportUsersCommand extends Command
|
||||
return $groupCenter;
|
||||
}
|
||||
|
||||
protected function createUser($offset, $data)
|
||||
protected function createUser($offset, $data): \Chill\MainBundle\Entity\User
|
||||
{
|
||||
$user = new User();
|
||||
$user
|
||||
|
||||
@@ -27,6 +27,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
/**
|
||||
* Class ChillUserSendRenewPasswordCodeCommand.
|
||||
*/
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand(name: 'chill:user:send-password-recover-code')]
|
||||
class ChillUserSendRenewPasswordCodeCommand extends Command
|
||||
{
|
||||
protected static $defaultDescription = 'Send a message with code to recover password';
|
||||
@@ -82,7 +83,6 @@ class ChillUserSendRenewPasswordCodeCommand extends Command
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('chill:user:send-password-recover-code')
|
||||
->addArgument('csvfile', InputArgument::REQUIRED, 'CSV file with the list of users')
|
||||
->addOption('template', null, InputOption::VALUE_REQUIRED, 'Template for email')
|
||||
->addOption('expiration', null, InputOption::VALUE_REQUIRED, 'Expiration of the link, as an unix timestamp')
|
||||
|
||||
@@ -17,6 +17,7 @@ use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand]
|
||||
class ExecuteCronJobCommand extends Command
|
||||
{
|
||||
protected static $defaultDescription = 'Execute the cronjob(s) given as argument, or one cronjob scheduled by system.';
|
||||
|
||||
@@ -19,6 +19,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand(name: 'chill:main:address-ref-from-best-addresses')]
|
||||
class LoadAddressesBEFromBestAddressCommand extends Command
|
||||
{
|
||||
protected static $defaultDescription = 'Import BE addresses from BeST Address (see https://osoc19.github.io/best/)';
|
||||
@@ -33,7 +34,6 @@ class LoadAddressesBEFromBestAddressCommand extends Command
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('chill:main:address-ref-from-best-addresses')
|
||||
->addArgument('lang', InputArgument::REQUIRED, "Language code, for example 'fr'")
|
||||
->addArgument('list', InputArgument::IS_ARRAY, "The list to add, for example 'full', or 'extract' (dev) or '1xxx' (brussel CP)")
|
||||
->addOption('send-report-email', 's', InputOption::VALUE_REQUIRED, 'Email address where a list of unimported addresses can be send');
|
||||
|
||||
@@ -18,6 +18,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand(name: 'chill:main:address-ref-from-ban')]
|
||||
class LoadAddressesFRFromBANCommand extends Command
|
||||
{
|
||||
protected static $defaultDescription = 'Import FR addresses from BAN (see https://adresses.data.gouv.fr';
|
||||
@@ -29,7 +30,7 @@ class LoadAddressesFRFromBANCommand extends Command
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('chill:main:address-ref-from-ban')
|
||||
$this
|
||||
->addArgument('departementNo', InputArgument::REQUIRED | InputArgument::IS_ARRAY, 'a list of departement numbers')
|
||||
->addOption('send-report-email', 's', InputOption::VALUE_REQUIRED, 'Email address where a list of unimported addresses can be send');
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand(name: 'chill:main:address-ref-from-bano')]
|
||||
class LoadAddressesFRFromBANOCommand extends Command
|
||||
{
|
||||
protected static $defaultDescription = 'Import FR addresses from bano (see https://bano.openstreetmap.fr';
|
||||
@@ -29,7 +30,7 @@ class LoadAddressesFRFromBANOCommand extends Command
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('chill:main:address-ref-from-bano')
|
||||
$this
|
||||
->addArgument('departementNo', InputArgument::REQUIRED | InputArgument::IS_ARRAY, 'a list of departement numbers')
|
||||
->addOption('send-report-email', 's', InputOption::VALUE_REQUIRED, 'Email address where a list of unimported addresses can be send');
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand(name: 'chill:main:address-ref-lux')]
|
||||
class LoadAddressesLUFromBDAddressCommand extends Command
|
||||
{
|
||||
protected static $defaultDescription = 'Import LUX addresses from BD addresses (see https://data.public.lu/fr/datasets/adresses-georeferencees-bd-adresses/)';
|
||||
@@ -30,7 +31,6 @@ class LoadAddressesLUFromBDAddressCommand extends Command
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('chill:main:address-ref-lux')
|
||||
->addOption('send-report-email', 's', InputOption::VALUE_REQUIRED, 'Email address where a list of unimported addresses can be send');
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ use Symfony\Component\Intl\Languages;
|
||||
/*
|
||||
* Load or update the languages entities command
|
||||
*/
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand(name: 'chill:main:languages:populate')]
|
||||
class LoadAndUpdateLanguagesCommand extends Command
|
||||
{
|
||||
final public const INCLUDE_ANCIENT = 'include_ancient';
|
||||
@@ -53,7 +54,6 @@ class LoadAndUpdateLanguagesCommand extends Command
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('chill:main:languages:populate')
|
||||
->addOption(
|
||||
self::INCLUDE_REGIONAL_VERSION,
|
||||
null,
|
||||
|
||||
@@ -18,6 +18,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Intl\Countries;
|
||||
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand(name: 'chill:main:countries:populate')]
|
||||
class LoadCountriesCommand extends Command
|
||||
{
|
||||
/**
|
||||
@@ -55,7 +56,6 @@ class LoadCountriesCommand extends Command
|
||||
*/
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('chill:main:countries:populate');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,7 @@ use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand(name: 'chill:main:postal-code:load:FR')]
|
||||
class LoadPostalCodeFR extends Command
|
||||
{
|
||||
protected static $defaultDescription = 'Load France\'s postal code from online open data';
|
||||
@@ -27,7 +28,6 @@ class LoadPostalCodeFR extends Command
|
||||
|
||||
public function configure(): void
|
||||
{
|
||||
$this->setName('chill:main:postal-code:load:FR');
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output): int
|
||||
|
||||
@@ -23,6 +23,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand(name: 'chill:main:postal-code:populate')]
|
||||
class LoadPostalCodesCommand extends Command
|
||||
{
|
||||
protected static $defaultDescription = 'Add the postal code from a csv file.';
|
||||
@@ -34,7 +35,7 @@ class LoadPostalCodesCommand extends Command
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('chill:main:postal-code:populate')
|
||||
$this
|
||||
->setHelp('This script will try to avoid existing postal code '
|
||||
."using the postal code and name. \n"
|
||||
.'The CSV file must have the following columns: '
|
||||
@@ -105,7 +106,7 @@ class LoadPostalCodesCommand extends Command
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
private function addPostalCode($row, OutputInterface $output)
|
||||
private function addPostalCode($row, OutputInterface $output): void
|
||||
{
|
||||
if ('FR' === $row[2] && 4 === \strlen((string) $row[0])) {
|
||||
// CP in FRANCE are on 5 digit
|
||||
|
||||
@@ -22,6 +22,7 @@ use Symfony\Component\Security\Core\Encoder\EncoderFactory;
|
||||
/**
|
||||
* Class SetPasswordCommand.
|
||||
*/
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand(name: 'chill:user:set_password')]
|
||||
class SetPasswordCommand extends Command
|
||||
{
|
||||
protected static $defaultDescription = 'set a password to user';
|
||||
@@ -41,7 +42,7 @@ class SetPasswordCommand extends Command
|
||||
->findOneBy(['username' => $username]);
|
||||
}
|
||||
|
||||
public function _setPassword(User $user, $password)
|
||||
public function _setPassword(User $user, $password): void
|
||||
{
|
||||
$defaultEncoder = new \Symfony\Component\PasswordHasher\Hasher\MessageDigestPasswordHasher('sha512', true, 5000);
|
||||
$encoders = [
|
||||
@@ -54,9 +55,9 @@ class SetPasswordCommand extends Command
|
||||
$this->entityManager->flush($user);
|
||||
}
|
||||
|
||||
public function configure()
|
||||
public function configure(): void
|
||||
{
|
||||
$this->setName('chill:user:set_password')
|
||||
$this
|
||||
->addArgument('username', InputArgument::REQUIRED, 'the user\'s '
|
||||
.'username you want to change password')
|
||||
->addArgument('password', InputArgument::OPTIONAL, 'the new password');
|
||||
|
||||
@@ -16,6 +16,7 @@ use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand]
|
||||
class SynchronizeEntityInfoViewsCommand extends Command
|
||||
{
|
||||
protected static $defaultDescription = 'Update or create sql views which provide info for various entities';
|
||||
|
||||
@@ -22,7 +22,7 @@ class AbsenceController extends AbstractController
|
||||
public function __construct(private readonly ChillSecurity $security, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||
|
||||
#[Route(path: '/{_locale}/absence', name: 'chill_main_user_absence_index', methods: ['GET', 'POST'])]
|
||||
public function setAbsence(Request $request)
|
||||
public function setAbsence(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
$user = $this->security->getUser();
|
||||
$form = $this->createForm(AbsenceType::class, $user);
|
||||
@@ -43,7 +43,7 @@ class AbsenceController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route(path: '/{_locale}/absence/unset', name: 'chill_main_user_absence_unset', methods: ['GET', 'POST'])]
|
||||
public function unsetAbsence(Request $request)
|
||||
public function unsetAbsence(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse
|
||||
{
|
||||
$user = $this->security->getUser();
|
||||
|
||||
|
||||
@@ -17,31 +17,31 @@ use Symfony\Component\Routing\Annotation\Route;
|
||||
class AdminController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/{_locale}/admin', name: 'chill_main_admin_central')]
|
||||
public function indexAction()
|
||||
public function indexAction(): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
return $this->render('@ChillMain/Admin/index.html.twig');
|
||||
}
|
||||
|
||||
#[Route(path: '/{_locale}/admin/language', name: 'chill_main_language_admin')]
|
||||
public function indexLanguageAction()
|
||||
public function indexLanguageAction(): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
return $this->render('@ChillMain/Admin/indexLanguage.html.twig');
|
||||
}
|
||||
|
||||
#[Route(path: '/{_locale}/admin/location', name: 'chill_main_location_admin')]
|
||||
public function indexLocationAction()
|
||||
public function indexLocationAction(): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
return $this->render('@ChillMain/Admin/indexLocation.html.twig');
|
||||
}
|
||||
|
||||
#[Route(path: '/{_locale}/admin/user', name: 'chill_main_user_admin')]
|
||||
public function indexUserAction()
|
||||
public function indexUserAction(): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
return $this->render('@ChillMain/Admin/indexUser.html.twig');
|
||||
}
|
||||
|
||||
#[Route(path: '/{_locale}/admin/dashboard', name: 'chill_main_dashboard_admin')]
|
||||
public function indexDashboardAction()
|
||||
public function indexDashboardAction(): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
return $this->render('@ChillMain/Admin/indexDashboard.html.twig');
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
class DefaultController extends AbstractController
|
||||
{
|
||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/homepage', name: 'chill_main_homepage')]
|
||||
public function indexAction()
|
||||
public function indexAction(): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
if ($this->isGranted('ROLE_ADMIN')) {
|
||||
return $this->redirectToRoute('chill_main_admin_central', [], 302);
|
||||
@@ -29,12 +29,12 @@ class DefaultController extends AbstractController
|
||||
}
|
||||
|
||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/homepage', name: 'chill_main_homepage_without_locale')]
|
||||
public function indexWithoutLocaleAction()
|
||||
public function indexWithoutLocaleAction(): \Symfony\Component\HttpFoundation\RedirectResponse
|
||||
{
|
||||
return $this->redirectToRoute('chill_main_homepage');
|
||||
}
|
||||
|
||||
public function testAction()
|
||||
public function testAction(): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
return $this->render('@ChillMain/Tabs/index.html.twig', [
|
||||
'tabs' => [
|
||||
|
||||
@@ -66,7 +66,7 @@ class ExportController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route(path: '/{_locale}/exports/download/{alias}', name: 'chill_main_export_download', methods: ['GET'])]
|
||||
public function downloadResultAction(Request $request, mixed $alias)
|
||||
public function downloadResultAction(Request $request, mixed $alias): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
/** @var ExportManager $exportManager */
|
||||
$exportManager = $this->exportManager;
|
||||
@@ -434,7 +434,7 @@ class ExportController extends AbstractController
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
private function forwardToGenerate(Request $request, DirectExportInterface|ExportInterface $export, $alias, ?SavedExport $savedExport)
|
||||
private function forwardToGenerate(Request $request, DirectExportInterface|ExportInterface $export, $alias, ?SavedExport $savedExport): \Symfony\Component\HttpFoundation\RedirectResponse
|
||||
{
|
||||
$dataCenters = $this->session->get('centers_step_raw', null);
|
||||
$dataFormatter = $this->session->get('formatter_step_raw', null);
|
||||
@@ -509,7 +509,7 @@ class ExportController extends AbstractController
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
private function selectCentersStep(Request $request, DirectExportInterface|ExportInterface $export, $alias, ?SavedExport $savedExport = null)
|
||||
private function selectCentersStep(Request $request, DirectExportInterface|ExportInterface $export, $alias, ?SavedExport $savedExport = null): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
if (!$this->filterStatsByCenters) {
|
||||
return $this->redirectToRoute('chill_main_export_new', [
|
||||
|
||||
@@ -18,7 +18,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
*/
|
||||
class MenuController extends AbstractController
|
||||
{
|
||||
public function writeMenuAction($menu, $layout, $activeRouteKey = null, array $args = [])
|
||||
public function writeMenuAction($menu, $layout, $activeRouteKey = null, array $args = []): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
return $this->render($layout, [
|
||||
'menu_composer' => $this->get('chill.main.menu_composer'),
|
||||
|
||||
@@ -95,9 +95,7 @@ class NotificationApiController
|
||||
return new JsonResponse(null, JsonResponse::HTTP_ACCEPTED, [], false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/mark/allread", name="chill_api_main_notification_mark_allread", methods={"POST"})
|
||||
*/
|
||||
#[Route(path: '/mark/allread', name: 'chill_api_main_notification_mark_allread', methods: ['POST'])]
|
||||
public function markAllRead(): JsonResponse
|
||||
{
|
||||
$user = $this->security->getUser();
|
||||
@@ -111,9 +109,7 @@ class NotificationApiController
|
||||
return new JsonResponse($modifiedNotificationIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/mark/undoallread", name="chill_api_main_notification_mark_undoallread", methods={"POST"})
|
||||
*/
|
||||
#[Route(path: '/mark/undoallread', name: 'chill_api_main_notification_mark_undoallread', methods: ['POST'])]
|
||||
public function undoAllRead(Request $request): JsonResponse
|
||||
{
|
||||
$user = $this->security->getUser();
|
||||
|
||||
@@ -45,7 +45,7 @@ final class PasswordController extends AbstractController
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/public/{_locale}/password/request-changed', name: 'password_request_recover_changed')]
|
||||
public function changeConfirmedAction()
|
||||
public function changeConfirmedAction(): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
return $this->render('@ChillMain/Password/recover_password_changed.html.twig');
|
||||
}
|
||||
@@ -190,7 +190,7 @@ final class PasswordController extends AbstractController
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/public/{_locale}/password/request-confirm', name: 'password_request_recover_confirm')]
|
||||
public function requestRecoverConfirmAction()
|
||||
public function requestRecoverConfirmAction(): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
return $this->render('@ChillMain/Password/request_recover_password_confirm.html.twig');
|
||||
}
|
||||
@@ -199,7 +199,7 @@ final class PasswordController extends AbstractController
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/{_locale}/my/password', name: 'change_my_password')]
|
||||
public function UserPasswordAction(Request $request)
|
||||
public function UserPasswordAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
if (!$this->security->isGranted('ROLE_USER')) {
|
||||
throw new AccessDeniedHttpException();
|
||||
@@ -246,7 +246,7 @@ final class PasswordController extends AbstractController
|
||||
/**
|
||||
* @return \Symfony\Component\Form\FormInterface
|
||||
*/
|
||||
protected function requestRecoverForm()
|
||||
protected function requestRecoverForm(): \Symfony\Component\Form\FormInterface
|
||||
{
|
||||
$builder = $this->createFormBuilder();
|
||||
$builder
|
||||
@@ -280,7 +280,7 @@ final class PasswordController extends AbstractController
|
||||
/**
|
||||
* @return \Symfony\Component\Form\FormInterface
|
||||
*/
|
||||
private function passwordForm(User $user)
|
||||
private function passwordForm(User $user): \Symfony\Component\Form\FormInterface
|
||||
{
|
||||
return $this
|
||||
->createForm(
|
||||
|
||||
@@ -34,7 +34,7 @@ class ScopeController extends AbstractController
|
||||
* Creates a new Scope entity.
|
||||
*/
|
||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/scope/create', name: 'admin_scope_create', methods: ['POST'])]
|
||||
public function createAction(Request $request)
|
||||
public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
$scope = new Scope();
|
||||
$form = $this->createCreateForm($scope);
|
||||
@@ -79,7 +79,7 @@ class ScopeController extends AbstractController
|
||||
* Lists all Scope entities.
|
||||
*/
|
||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/scope/', name: 'admin_scope')]
|
||||
public function indexAction()
|
||||
public function indexAction(): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
$em = $this->managerRegistry->getManager();
|
||||
|
||||
@@ -94,7 +94,7 @@ class ScopeController extends AbstractController
|
||||
* Displays a form to create a new Scope entity.
|
||||
*/
|
||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/scope/new', name: 'admin_scope_new')]
|
||||
public function newAction()
|
||||
public function newAction(): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
$scope = new Scope();
|
||||
$form = $this->createCreateForm($scope);
|
||||
@@ -108,7 +108,7 @@ class ScopeController extends AbstractController
|
||||
/**
|
||||
* Finds and displays a Scope entity.
|
||||
*/
|
||||
public function showAction(mixed $id)
|
||||
public function showAction(mixed $id): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
$em = $this->managerRegistry->getManager();
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class SearchController extends AbstractController
|
||||
public function __construct(protected SearchProvider $searchProvider, protected TranslatorInterface $translator, protected PaginatorFactory $paginatorFactory, protected SearchApi $searchApi) {}
|
||||
|
||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/search/advanced/{name}', name: 'chill_main_advanced_search')]
|
||||
public function advancedSearchAction(mixed $name, Request $request)
|
||||
public function advancedSearchAction(mixed $name, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
try {
|
||||
/** @var Chill\MainBundle\Search\SearchProvider $variable */
|
||||
@@ -80,7 +80,7 @@ class SearchController extends AbstractController
|
||||
}
|
||||
|
||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/search/advanced', name: 'chill_main_advanced_search_list')]
|
||||
public function advancedSearchListAction(Request $request)
|
||||
public function advancedSearchListAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
/** @var Chill\MainBundle\Search\SearchProvider $variable */
|
||||
$searchProvider = $this->searchProvider;
|
||||
|
||||
@@ -23,7 +23,7 @@ class TimelineCenterController extends AbstractController
|
||||
public function __construct(protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory, private readonly Security $security) {}
|
||||
|
||||
#[Route(path: '/{_locale}/center/timeline', name: 'chill_center_timeline', methods: ['GET'])]
|
||||
public function centerAction(Request $request)
|
||||
public function centerAction(Request $request): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
// collect reachable center for each group
|
||||
$user = $this->security->getUser();
|
||||
|
||||
@@ -21,7 +21,7 @@ class UIController extends AbstractController
|
||||
{
|
||||
public function showNotificationUserCounterAction(
|
||||
CountNotificationUser $counter,
|
||||
) {
|
||||
): \Symfony\Component\HttpFoundation\Response {
|
||||
$nb = $counter->getSumNotification($this->getUser());
|
||||
|
||||
return $this->render('@ChillMain/UI/notification_user_counter.html.twig', [
|
||||
|
||||
@@ -203,7 +203,7 @@ class UserController extends CRUDController
|
||||
* Displays a form to edit the user current location.
|
||||
*/
|
||||
#[Route(path: '/{_locale}/main/user/current-location/edit', name: 'chill_main_user_currentlocation_edit')]
|
||||
public function editCurrentLocationAction(Request $request)
|
||||
public function editCurrentLocationAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
$user = $this->security->getUser();
|
||||
$form = $this->createForm(UserCurrentLocationType::class, $user)
|
||||
@@ -234,7 +234,7 @@ class UserController extends CRUDController
|
||||
* Displays a form to edit the user password.
|
||||
*/
|
||||
#[Route(path: '/{_locale}/admin/user/{id}/edit_password', name: 'admin_user_edit_password')]
|
||||
public function editPasswordAction(User $user, Request $request)
|
||||
public function editPasswordAction(User $user, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
$editForm = $this->createEditPasswordForm($user);
|
||||
$editForm->handleRequest($request);
|
||||
@@ -244,7 +244,7 @@ class UserController extends CRUDController
|
||||
|
||||
// logging for prod
|
||||
$this->logger->info('update password for an user', [
|
||||
'by' => $this->getUser()->getUsername(),
|
||||
'by' => $this->getUser()->getUserIdentifier(),
|
||||
'user' => $user->getUsername(),
|
||||
]);
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ final class UserProfileController extends AbstractController
|
||||
* User profile that allows editing of phonenumber and visualization of certain data.
|
||||
*/
|
||||
#[Route(path: '/{_locale}/main/user/my-profile', name: 'chill_main_user_profile')]
|
||||
public function __invoke(Request $request)
|
||||
public function __invoke(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
if (!$this->security->isGranted('ROLE_USER')) {
|
||||
throw new AccessDeniedHttpException();
|
||||
|
||||
@@ -51,7 +51,7 @@ class LoadAddressReferences extends AbstractFixture implements ContainerAwareInt
|
||||
$manager->flush();
|
||||
}
|
||||
|
||||
public function setContainer(?ContainerInterface $container = null)
|
||||
public function setContainer(?ContainerInterface $container = null): void
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ class LoadAddressReferences extends AbstractFixture implements ContainerAwareInt
|
||||
*
|
||||
* @return AddressReference
|
||||
*/
|
||||
private function getRandomAddressReference()
|
||||
private function getRandomAddressReference(): \Chill\MainBundle\Entity\AddressReference
|
||||
{
|
||||
$ar = new AddressReference();
|
||||
|
||||
@@ -84,7 +84,7 @@ class LoadAddressReferences extends AbstractFixture implements ContainerAwareInt
|
||||
*
|
||||
* @return Point
|
||||
*/
|
||||
private function getRandomPoint()
|
||||
private function getRandomPoint(): \Chill\MainBundle\Doctrine\Model\Point
|
||||
{
|
||||
$lonBrussels = 4.35243;
|
||||
$latBrussels = 50.84676;
|
||||
|
||||
@@ -43,7 +43,7 @@ class LoadCountries extends AbstractFixture implements ContainerAwareInterface,
|
||||
$manager->flush();
|
||||
}
|
||||
|
||||
public function setContainer(?ContainerInterface $container = null)
|
||||
public function setContainer(?ContainerInterface $container = null): void
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class LoadLanguages extends AbstractFixture implements ContainerAwareInterface,
|
||||
$manager->flush();
|
||||
}
|
||||
|
||||
public function setContainer(?ContainerInterface $container = null)
|
||||
public function setContainer(?ContainerInterface $container = null): void
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class LoadLocationType extends AbstractFixture implements ContainerAwareInterfac
|
||||
$manager->flush();
|
||||
}
|
||||
|
||||
public function setContainer(?ContainerInterface $container = null)
|
||||
public function setContainer(?ContainerInterface $container = null): void
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ class LoadPostalCodes extends AbstractFixture implements OrderedFixtureInterface
|
||||
$this->loadPostalCodeCSV($manager, self::$postalCodeFrance, 'FR');
|
||||
}
|
||||
|
||||
private function loadPostalCodeCSV(ObjectManager $manager, string $csv, string $countryCode)
|
||||
private function loadPostalCodeCSV(ObjectManager $manager, string $csv, string $countryCode): void
|
||||
{
|
||||
$lines = str_getcsv($csv, "\n");
|
||||
$country = $manager->getRepository(Country::class)
|
||||
|
||||
@@ -92,7 +92,7 @@ class LoadUsers extends AbstractFixture implements ContainerAwareInterface, Orde
|
||||
$manager->flush();
|
||||
}
|
||||
|
||||
public function setContainer(?ContainerInterface $container = null)
|
||||
public function setContainer(?ContainerInterface $container = null): void
|
||||
{
|
||||
if (null === $container) {
|
||||
throw new \LogicException('$container should not be null');
|
||||
|
||||
@@ -102,7 +102,7 @@ class ChillMainExtension extends Extension implements
|
||||
*/
|
||||
protected $widgetFactories = [];
|
||||
|
||||
public function addWidgetFactory(WidgetFactoryInterface $factory)
|
||||
public function addWidgetFactory(WidgetFactoryInterface $factory): void
|
||||
{
|
||||
$this->widgetFactories[] = $factory;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ class ChillMainExtension extends Extension implements
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
public function load(array $configs, ContainerBuilder $container): void
|
||||
{
|
||||
// configuration for main bundle
|
||||
$configuration = $this->getConfiguration($configs, $container);
|
||||
@@ -232,7 +232,7 @@ class ChillMainExtension extends Extension implements
|
||||
// $this->configureSms($config['short_messages'], $container, $loader);
|
||||
}
|
||||
|
||||
public function prepend(ContainerBuilder $container)
|
||||
public function prepend(ContainerBuilder $container): void
|
||||
{
|
||||
$this->prependNotifierTexterWithLegacyData($container);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ use Symfony\Component\DependencyInjection\Reference;
|
||||
|
||||
class ACLFlagsCompilerPass implements CompilerPassInterface
|
||||
{
|
||||
public function process(ContainerBuilder $container)
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
$permissionGroupType = $container->getDefinition(PermissionsGroupType::class);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ use Symfony\Component\DependencyInjection\Reference;
|
||||
*/
|
||||
class ExportsCompilerPass implements CompilerPassInterface
|
||||
{
|
||||
public function process(ContainerBuilder $container)
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
if (!$container->has(ExportManager::class)) {
|
||||
throw new \LogicException('service '.ExportManager::class.' is not defined. It is required by ExportsCompilerPass');
|
||||
@@ -45,7 +45,7 @@ class ExportsCompilerPass implements CompilerPassInterface
|
||||
private function compileExportElementsProvider(
|
||||
Definition $chillManagerDefinition,
|
||||
ContainerBuilder $container,
|
||||
) {
|
||||
): void {
|
||||
$taggedServices = $container->findTaggedServiceIds(
|
||||
'chill.export_elements_provider'
|
||||
);
|
||||
@@ -74,7 +74,7 @@ class ExportsCompilerPass implements CompilerPassInterface
|
||||
private function compileFormatters(
|
||||
Definition $chillManagerDefinition,
|
||||
ContainerBuilder $container,
|
||||
) {
|
||||
): void {
|
||||
$taggedServices = $container->findTaggedServiceIds(
|
||||
'chill.export_formatter'
|
||||
);
|
||||
|
||||
@@ -18,7 +18,7 @@ use Symfony\Component\DependencyInjection\Reference;
|
||||
|
||||
class MenuCompilerPass implements CompilerPassInterface
|
||||
{
|
||||
public function process(ContainerBuilder $container)
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
if (!$container->hasDefinition('chill.main.menu_composer')) {
|
||||
throw new \LogicException(sprintf('The service %s does not exists in container.', MenuComposer::class));
|
||||
|
||||
@@ -18,7 +18,7 @@ use Symfony\Component\DependencyInjection\Reference;
|
||||
|
||||
class NotificationCounterCompilerPass implements CompilerPassInterface
|
||||
{
|
||||
public function process(ContainerBuilder $container)
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
if (!$container->hasDefinition(CountNotificationUser::class)) {
|
||||
throw new \LogicException('The service '.CountNotificationUser::class.' should be defined');
|
||||
|
||||
@@ -22,7 +22,7 @@ class SearchableServicesCompilerPass implements CompilerPassInterface
|
||||
*
|
||||
* @see \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()
|
||||
*/
|
||||
public function process(ContainerBuilder $container)
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
if (!$container->hasDefinition('chill_main.search_provider')) {
|
||||
throw new \LogicException('service chill_main.search_provider is not defined.');
|
||||
|
||||
@@ -21,7 +21,7 @@ use Symfony\Component\DependencyInjection\Reference;
|
||||
*/
|
||||
class TimelineCompilerClass implements CompilerPassInterface
|
||||
{
|
||||
public function process(ContainerBuilder $container)
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
if (!$container->hasDefinition('chill_main.timeline_builder')) {
|
||||
throw new \LogicException('service chill_main.timeline_builder is not defined.');
|
||||
|
||||
@@ -19,7 +19,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
*/
|
||||
class WidgetsCompilerPass extends AbstractWidgetsCompilerPass
|
||||
{
|
||||
public function process(ContainerBuilder $container)
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
$this->doProcess($container, 'chill_main', 'chill_main.widgets');
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
*/
|
||||
class ConfigConsistencyCompilerPass implements CompilerPassInterface
|
||||
{
|
||||
public function process(ContainerBuilder $container)
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
$availableLanguages = $container
|
||||
->getParameter('chill_main.available_languages');
|
||||
|
||||
@@ -123,7 +123,7 @@ abstract class AbstractWidgetsCompilerPass implements CompilerPassInterface
|
||||
ContainerBuilder $container,
|
||||
$extension,
|
||||
$containerWidgetConfigParameterName,
|
||||
) {
|
||||
): void {
|
||||
if (!$container->hasDefinition(self::WIDGET_MANAGER)) {
|
||||
throw new \LogicException('the service '.self::WIDGET_MANAGER.' should be present. It is required by '.self::class);
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ trait AddWidgetConfigurationTrait
|
||||
/**
|
||||
* @param WidgetFactoryInterface[] $widgetFactories
|
||||
*/
|
||||
public function setWidgetFactories(array $widgetFactories)
|
||||
public function setWidgetFactories(array $widgetFactories): void
|
||||
{
|
||||
$this->widgetFactories = $widgetFactories;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class Age extends FunctionNode
|
||||
);
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
public function parse(Parser $parser): void
|
||||
{
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER);
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_OPEN_PARENTHESIS);
|
||||
|
||||
@@ -42,7 +42,7 @@ class Extract extends FunctionNode
|
||||
);
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
public function parse(Parser $parser): void
|
||||
{
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER);
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_OPEN_PARENTHESIS);
|
||||
|
||||
@@ -30,7 +30,7 @@ class GetJsonFieldByKey extends FunctionNode
|
||||
);
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
public function parse(Parser $parser): void
|
||||
{
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER);
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_OPEN_PARENTHESIS);
|
||||
|
||||
@@ -35,7 +35,7 @@ class Greatest extends FunctionNode
|
||||
return 'GREATEST('.implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)).')';
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
public function parse(Parser $parser): void
|
||||
{
|
||||
$this->exprs = [];
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class JsonAggregate extends FunctionNode
|
||||
return sprintf('jsonb_agg(%s)', $this->expr->dispatch($sqlWalker));
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
public function parse(Parser $parser): void
|
||||
{
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER);
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_OPEN_PARENTHESIS);
|
||||
|
||||
@@ -34,7 +34,7 @@ class JsonBuildObject extends FunctionNode
|
||||
return 'JSONB_BUILD_OBJECT('.implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)).')';
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
public function parse(Parser $parser): void
|
||||
{
|
||||
$lexer = $parser->getLexer();
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER);
|
||||
|
||||
@@ -26,7 +26,7 @@ class JsonExtract extends FunctionNode
|
||||
return sprintf('%s->>%s', $this->element->dispatch($sqlWalker), $this->keyToExtract->dispatch($sqlWalker));
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
public function parse(Parser $parser): void
|
||||
{
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER);
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_OPEN_PARENTHESIS);
|
||||
|
||||
@@ -35,7 +35,7 @@ class Least extends FunctionNode
|
||||
return 'LEAST('.implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)).')';
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
public function parse(Parser $parser): void
|
||||
{
|
||||
$this->exprs = [];
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class STContains extends FunctionNode
|
||||
', '.$this->secondPart->dispatch($sqlWalker).')';
|
||||
}
|
||||
|
||||
public function parse(\Doctrine\ORM\Query\Parser $parser)
|
||||
public function parse(\Doctrine\ORM\Query\Parser $parser): void
|
||||
{
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER);
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_OPEN_PARENTHESIS);
|
||||
|
||||
@@ -24,7 +24,7 @@ class STX extends FunctionNode
|
||||
return sprintf('ST_X(%s)', $this->field->dispatch($sqlWalker));
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
public function parse(Parser $parser): void
|
||||
{
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER);
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_OPEN_PARENTHESIS);
|
||||
|
||||
@@ -24,7 +24,7 @@ class STY extends FunctionNode
|
||||
return sprintf('ST_Y(%s)', $this->field->dispatch($sqlWalker));
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
public function parse(Parser $parser): void
|
||||
{
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER);
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_OPEN_PARENTHESIS);
|
||||
|
||||
@@ -25,7 +25,7 @@ class Similarity extends FunctionNode
|
||||
', '.$this->secondPart->dispatch($sqlWalker).')';
|
||||
}
|
||||
|
||||
public function parse(\Doctrine\ORM\Query\Parser $parser)
|
||||
public function parse(\Doctrine\ORM\Query\Parser $parser): void
|
||||
{
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER);
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_OPEN_PARENTHESIS);
|
||||
|
||||
@@ -26,7 +26,7 @@ class StrictWordSimilarityOPS extends \Doctrine\ORM\Query\AST\Functions\Function
|
||||
' <<% '.$this->secondPart->dispatch($sqlWalker);
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
public function parse(Parser $parser): void
|
||||
{
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER);
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_OPEN_PARENTHESIS);
|
||||
|
||||
@@ -33,7 +33,7 @@ class ToChar extends FunctionNode
|
||||
);
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
public function parse(Parser $parser): void
|
||||
{
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER);
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_OPEN_PARENTHESIS);
|
||||
|
||||
@@ -28,7 +28,7 @@ class Unaccent extends FunctionNode
|
||||
return 'UNACCENT('.$this->string->dispatch($sqlWalker).')';
|
||||
}
|
||||
|
||||
public function parse(\Doctrine\ORM\Query\Parser $parser)
|
||||
public function parse(\Doctrine\ORM\Query\Parser $parser): void
|
||||
{
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER);
|
||||
$parser->match(\Doctrine\ORM\Query\TokenType::T_OPEN_PARENTHESIS);
|
||||
|
||||
@@ -274,7 +274,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getId()
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
@@ -289,7 +289,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
|
||||
return $this->isNoAddress;
|
||||
}
|
||||
|
||||
public function getLinkedToThirdParty()
|
||||
public function getLinkedToThirdParty(): ?\Chill\ThirdPartyBundle\Entity\ThirdParty
|
||||
{
|
||||
return $this->linkedToThirdParty;
|
||||
}
|
||||
@@ -334,7 +334,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public function getStreetAddress1()
|
||||
public function getStreetAddress1(): string
|
||||
{
|
||||
return $this->street;
|
||||
}
|
||||
@@ -346,7 +346,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public function getStreetAddress2()
|
||||
public function getStreetAddress2(): string
|
||||
{
|
||||
return $this->streetNumber;
|
||||
}
|
||||
@@ -575,7 +575,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
|
||||
*
|
||||
* @param array $payload
|
||||
*/
|
||||
public function validate(ExecutionContextInterface $context, $payload)
|
||||
public function validate(ExecutionContextInterface $context, $payload): void
|
||||
{
|
||||
if (!$this->getValidFrom() instanceof \DateTime) {
|
||||
$context
|
||||
|
||||
@@ -90,7 +90,7 @@ class Center implements HasCenterInterface, \Stringable
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class CommentEmbeddable
|
||||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getDate()
|
||||
public function getDate(): ?\DateTime
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
@@ -51,17 +51,17 @@ class CommentEmbeddable
|
||||
return null === $this->getComment() || '' === $this->getComment();
|
||||
}
|
||||
|
||||
public function setComment(?string $comment)
|
||||
public function setComment(?string $comment): void
|
||||
{
|
||||
$this->comment = $comment;
|
||||
}
|
||||
|
||||
public function setDate(?\DateTime $date)
|
||||
public function setDate(?\DateTime $date): void
|
||||
{
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
public function setUserId(?int $userId)
|
||||
public function setUserId(?int $userId): void
|
||||
{
|
||||
$this->userId = $userId;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class Language
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
public function getId(): ?string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ class Language
|
||||
*
|
||||
* @return string array
|
||||
*/
|
||||
public function getName()
|
||||
public function getName(): array
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ class Notification implements TrackUpdateInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addAddressesEmail(string $email)
|
||||
public function addAddressesEmail(string $email): void
|
||||
{
|
||||
if (!\in_array($email, $this->addressesEmails, true)) {
|
||||
$this->addressesEmails[] = $email;
|
||||
@@ -274,7 +274,7 @@ class Notification implements TrackUpdateInterface
|
||||
}
|
||||
|
||||
#[ORM\PreFlush]
|
||||
public function registerUnread()
|
||||
public function registerUnread(): void
|
||||
{
|
||||
foreach ($this->addedAddresses as $addressee) {
|
||||
$this->addUnreadBy($addressee);
|
||||
@@ -312,7 +312,7 @@ class Notification implements TrackUpdateInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeAddressesEmail(string $email)
|
||||
public function removeAddressesEmail(string $email): void
|
||||
{
|
||||
if (\in_array($email, $this->addressesEmails, true)) {
|
||||
$this->addressesEmails = array_filter($this->addressesEmails, static fn ($e) => $e !== $email);
|
||||
|
||||
@@ -57,7 +57,7 @@ class PermissionsGroup
|
||||
$this->groupCenters = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function addRoleScope(RoleScope $roleScope)
|
||||
public function addRoleScope(RoleScope $roleScope): void
|
||||
{
|
||||
$this->roleScopes->add($roleScope);
|
||||
}
|
||||
@@ -65,7 +65,7 @@ class PermissionsGroup
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getFlags()
|
||||
public function getFlags(): array
|
||||
{
|
||||
return $this->flags;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ class PermissionsGroup
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getId()
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ class PermissionsGroup
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ class PermissionsGroup
|
||||
* Test that a role scope is associated only once
|
||||
* with the permission group.
|
||||
*/
|
||||
public function isRoleScopePresentOnce(ExecutionContextInterface $context)
|
||||
public function isRoleScopePresentOnce(ExecutionContextInterface $context): void
|
||||
{
|
||||
$roleScopesId = array_map(
|
||||
static fn (RoleScope $roleScope) => $roleScope->getId(),
|
||||
@@ -115,7 +115,7 @@ class PermissionsGroup
|
||||
/**
|
||||
* @throws \RuntimeException if the roleScope could not be removed
|
||||
*/
|
||||
public function removeRoleScope(RoleScope $roleScope)
|
||||
public function removeRoleScope(RoleScope $roleScope): void
|
||||
{
|
||||
$result = $this->roleScopes->removeElement($roleScope);
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCode()
|
||||
public function getCode(): ?string
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
|
||||
*
|
||||
* @return Country
|
||||
*/
|
||||
public function getCountry()
|
||||
public function getCountry(): ?\Chill\MainBundle\Entity\Country
|
||||
{
|
||||
return $this->country;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getId()
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
@@ -132,7 +132,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getOrigin()
|
||||
public function getOrigin(): int
|
||||
{
|
||||
return $this->origin;
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function eraseCredentials() {}
|
||||
public function eraseCredentials(): void {}
|
||||
|
||||
public function getAbsenceStart(): ?\DateTimeImmutable
|
||||
{
|
||||
@@ -153,7 +153,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAttributes()
|
||||
public function getAttributes(): array
|
||||
{
|
||||
if (null === $this->attributes) {
|
||||
$this->attributes = [];
|
||||
@@ -180,7 +180,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getEmailCanonical()
|
||||
public function getEmailCanonical(): ?string
|
||||
{
|
||||
return $this->emailCanonical;
|
||||
}
|
||||
@@ -307,7 +307,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUsername()
|
||||
public function getUsername(): string
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
@@ -320,7 +320,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUsernameCanonical()
|
||||
public function getUsernameCanonical(): ?string
|
||||
{
|
||||
return $this->usernameCanonical;
|
||||
}
|
||||
@@ -341,7 +341,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isAccountNonLocked()
|
||||
public function isAccountNonLocked(): bool
|
||||
{
|
||||
return $this->locked;
|
||||
}
|
||||
@@ -357,7 +357,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isEnabled()
|
||||
public function isEnabled(): bool
|
||||
{
|
||||
return $this->enabled;
|
||||
}
|
||||
@@ -367,7 +367,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
|
||||
* use this function to avoid a user to be associated to the same groupCenter
|
||||
* more than once.
|
||||
*/
|
||||
public function isGroupCenterPresentOnce(ExecutionContextInterface $context)
|
||||
public function isGroupCenterPresentOnce(ExecutionContextInterface $context): void
|
||||
{
|
||||
$groupCentersIds = [];
|
||||
|
||||
@@ -389,7 +389,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
|
||||
/**
|
||||
* @throws \RuntimeException if the groupCenter is not in the collection
|
||||
*/
|
||||
public function removeGroupCenter(GroupCenter $groupCenter)
|
||||
public function removeGroupCenter(GroupCenter $groupCenter): void
|
||||
{
|
||||
if (false === $this->groupCenters->removeElement($groupCenter)) {
|
||||
throw new \RuntimeException('The groupCenter could not be removed, it seems not to be associated with the user. Aborting.');
|
||||
|
||||
@@ -160,7 +160,7 @@ class ExportManager
|
||||
*
|
||||
* @internal used by DI
|
||||
*/
|
||||
public function addFormatter(FormatterInterface $formatter, string $alias)
|
||||
public function addFormatter(FormatterInterface $formatter, string $alias): void
|
||||
{
|
||||
$this->formatters[$alias] = $formatter;
|
||||
}
|
||||
@@ -534,7 +534,7 @@ class ExportManager
|
||||
QueryBuilder $qb,
|
||||
array $data,
|
||||
array $center,
|
||||
) {
|
||||
): void {
|
||||
$aggregators = $this->retrieveUsedAggregators($data);
|
||||
|
||||
foreach ($aggregators as $alias => $aggregator) {
|
||||
@@ -561,7 +561,7 @@ class ExportManager
|
||||
QueryBuilder $qb,
|
||||
mixed $data,
|
||||
array $centers,
|
||||
) {
|
||||
): void {
|
||||
$filters = $this->retrieveUsedFilters($data);
|
||||
|
||||
foreach ($filters as $alias => $filter) {
|
||||
@@ -658,7 +658,7 @@ class ExportManager
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
private function retrieveUsedModifiers(mixed $data)
|
||||
private function retrieveUsedModifiers(mixed $data): array
|
||||
{
|
||||
if (null === $data) {
|
||||
return [];
|
||||
|
||||
@@ -59,7 +59,7 @@ class CSVFormatter implements FormatterInterface
|
||||
/**
|
||||
* @uses appendAggregatorForm
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, $exportAlias, array $aggregatorAliases)
|
||||
public function buildForm(FormBuilderInterface $builder, $exportAlias, array $aggregatorAliases): void
|
||||
{
|
||||
$aggregators = $this->exportManager->getAggregators($aggregatorAliases);
|
||||
$nb = \count($aggregatorAliases);
|
||||
@@ -119,7 +119,7 @@ class CSVFormatter implements FormatterInterface
|
||||
array $exportData,
|
||||
array $filtersData,
|
||||
array $aggregatorsData,
|
||||
) {
|
||||
): \Symfony\Component\HttpFoundation\Response {
|
||||
$this->result = $result;
|
||||
$this->orderingHeaders($formatterData);
|
||||
$this->export = $this->exportManager->getExport($exportAlias);
|
||||
@@ -145,7 +145,7 @@ class CSVFormatter implements FormatterInterface
|
||||
return 'tabular';
|
||||
}
|
||||
|
||||
protected function gatherLabels()
|
||||
protected function gatherLabels(): array
|
||||
{
|
||||
return array_merge(
|
||||
$this->gatherLabelsFromAggregators(),
|
||||
@@ -345,7 +345,7 @@ class CSVFormatter implements FormatterInterface
|
||||
*
|
||||
* @param string $nbAggregators
|
||||
*/
|
||||
private function appendAggregatorForm(FormBuilderInterface $builder, $nbAggregators)
|
||||
private function appendAggregatorForm(FormBuilderInterface $builder, $nbAggregators): void
|
||||
{
|
||||
$builder->add('order', ChoiceType::class, [
|
||||
'choices' => array_combine(
|
||||
|
||||
@@ -69,7 +69,7 @@ class CSVListFormatter implements FormatterInterface
|
||||
FormBuilderInterface $builder,
|
||||
$exportAlias,
|
||||
array $aggregatorAliases,
|
||||
) {
|
||||
): void {
|
||||
$builder->add('numerotation', ChoiceType::class, [
|
||||
'choices' => [
|
||||
'yes' => true,
|
||||
@@ -109,7 +109,7 @@ class CSVListFormatter implements FormatterInterface
|
||||
array $exportData,
|
||||
array $filtersData,
|
||||
array $aggregatorsData,
|
||||
) {
|
||||
): \Symfony\Component\HttpFoundation\Response {
|
||||
$this->result = $result;
|
||||
$this->exportAlias = $exportAlias;
|
||||
$this->exportData = $exportData;
|
||||
|
||||
@@ -67,7 +67,7 @@ class CSVPivotedListFormatter implements FormatterInterface
|
||||
FormBuilderInterface $builder,
|
||||
$exportAlias,
|
||||
array $aggregatorAliases,
|
||||
) {
|
||||
): void {
|
||||
$builder->add('numerotation', ChoiceType::class, [
|
||||
'choices' => [
|
||||
'yes' => true,
|
||||
@@ -108,7 +108,7 @@ class CSVPivotedListFormatter implements FormatterInterface
|
||||
array $exportData,
|
||||
array $filtersData,
|
||||
array $aggregatorsData,
|
||||
) {
|
||||
): \Symfony\Component\HttpFoundation\Response {
|
||||
$this->result = $result;
|
||||
$this->exportAlias = $exportAlias;
|
||||
$this->exportData = $exportData;
|
||||
|
||||
@@ -130,7 +130,7 @@ class SpreadSheetFormatter implements FormatterInterface
|
||||
FormBuilderInterface $builder,
|
||||
$exportAlias,
|
||||
array $aggregatorAliases,
|
||||
) {
|
||||
): void {
|
||||
// choosing between formats
|
||||
$builder->add('format', ChoiceType::class, [
|
||||
'choices' => [
|
||||
@@ -417,7 +417,7 @@ class SpreadSheetFormatter implements FormatterInterface
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getDisplayableResult($key, mixed $value)
|
||||
protected function getDisplayableResult($key, mixed $value): mixed
|
||||
{
|
||||
if (false === $this->cacheDisplayableResultIsInitialized) {
|
||||
$this->initializeCache($key);
|
||||
|
||||
@@ -73,7 +73,7 @@ class SpreadsheetListFormatter implements FormatterInterface
|
||||
FormBuilderInterface $builder,
|
||||
$exportAlias,
|
||||
array $aggregatorAliases,
|
||||
) {
|
||||
): void {
|
||||
$builder
|
||||
->add('format', ChoiceType::class, [
|
||||
'choices' => [
|
||||
@@ -121,7 +121,7 @@ class SpreadsheetListFormatter implements FormatterInterface
|
||||
array $exportData,
|
||||
array $filtersData,
|
||||
array $aggregatorsData,
|
||||
) {
|
||||
): \Symfony\Component\HttpFoundation\Response {
|
||||
$this->result = $result;
|
||||
$this->exportAlias = $exportAlias;
|
||||
$this->exportData = $exportData;
|
||||
|
||||
@@ -81,7 +81,7 @@ class ExportAddressHelper
|
||||
|
||||
public function __construct(private readonly AddressRender $addressRender, private readonly AddressRepository $addressRepository, private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
|
||||
|
||||
public function addSelectClauses(int $params, QueryBuilder $queryBuilder, $entityName = 'address', $prefix = 'add')
|
||||
public function addSelectClauses(int $params, QueryBuilder $queryBuilder, $entityName = 'address', $prefix = 'add'): void
|
||||
{
|
||||
foreach (self::ALL as $key => $bitmask) {
|
||||
if (($params & $bitmask) === $bitmask) {
|
||||
|
||||
@@ -19,7 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class AbsenceType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('absenceStart', ChillDateType::class, [
|
||||
@@ -29,7 +29,7 @@ class AbsenceType extends AbstractType
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => User::class,
|
||||
|
||||
@@ -20,7 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class CenterType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name', TextType::class, [
|
||||
@@ -32,7 +32,7 @@ class CenterType extends AbstractType
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver
|
||||
->setDefault('class', Center::class);
|
||||
|
||||
@@ -55,7 +55,7 @@ class PostalCodeChoiceLoader implements ChoiceLoaderInterface
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function loadChoicesForValues(array $values, $value = null)
|
||||
public function loadChoicesForValues(array $values, $value = null): array
|
||||
{
|
||||
$choices = [];
|
||||
|
||||
@@ -75,7 +75,7 @@ class PostalCodeChoiceLoader implements ChoiceLoaderInterface
|
||||
*
|
||||
* @return array|string[]
|
||||
*/
|
||||
public function loadValuesForChoices(array $choices, $value = null)
|
||||
public function loadValuesForChoices(array $choices, $value = null): array
|
||||
{
|
||||
$values = [];
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddressDataMapper implements DataMapperInterface
|
||||
* @param Address $address
|
||||
* @param \Iterator $forms
|
||||
*/
|
||||
public function mapDataToForms($address, \Traversable $forms)
|
||||
public function mapDataToForms($address, \Traversable $forms): void
|
||||
{
|
||||
if (null === $address) {
|
||||
return;
|
||||
@@ -78,7 +78,7 @@ class AddressDataMapper implements DataMapperInterface
|
||||
* @param \Iterator $forms
|
||||
* @param Address $address
|
||||
*/
|
||||
public function mapFormsToData(\Traversable $forms, &$address)
|
||||
public function mapFormsToData(\Traversable $forms, &$address): void
|
||||
{
|
||||
if (!$address instanceof Address) {
|
||||
$address = new Address();
|
||||
|
||||
@@ -21,7 +21,7 @@ final class PrivateCommentDataMapper extends AbstractType implements DataMapperI
|
||||
{
|
||||
public function __construct(private readonly Security $security) {}
|
||||
|
||||
public function mapDataToForms($viewData, \Traversable $forms)
|
||||
public function mapDataToForms($viewData, \Traversable $forms): void
|
||||
{
|
||||
if (null === $viewData) {
|
||||
return null;
|
||||
@@ -36,7 +36,7 @@ final class PrivateCommentDataMapper extends AbstractType implements DataMapperI
|
||||
$forms['comments']->setData($viewData->getCommentForUser($this->security->getUser()));
|
||||
}
|
||||
|
||||
public function mapFormsToData(\Traversable $forms, &$viewData)
|
||||
public function mapFormsToData(\Traversable $forms, &$viewData): void
|
||||
{
|
||||
$forms = iterator_to_array($forms);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ use Symfony\Component\Form\Exception;
|
||||
|
||||
class RollingDateDataMapper implements DataMapperInterface
|
||||
{
|
||||
public function mapDataToForms($viewData, \Traversable $forms)
|
||||
public function mapDataToForms($viewData, \Traversable $forms): void
|
||||
{
|
||||
if (null === $viewData) {
|
||||
return;
|
||||
|
||||
@@ -18,7 +18,7 @@ class ScopePickerDataMapper implements DataMapperInterface
|
||||
{
|
||||
public function __construct(private readonly ?Scope $scope = null) {}
|
||||
|
||||
public function mapDataToForms($data, \Traversable $forms)
|
||||
public function mapDataToForms($data, \Traversable $forms): void
|
||||
{
|
||||
$forms = iterator_to_array($forms);
|
||||
|
||||
@@ -37,7 +37,7 @@ class ScopePickerDataMapper implements DataMapperInterface
|
||||
}
|
||||
}
|
||||
|
||||
public function mapFormsToData(\Traversable $forms, &$data)
|
||||
public function mapFormsToData(\Traversable $forms, &$data): void
|
||||
{
|
||||
$forms = iterator_to_array($forms);
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class IdToEntityDataTransformer implements DataTransformerInterface
|
||||
*
|
||||
* @return array|object[]|T[]|T|object
|
||||
*/
|
||||
public function reverseTransform($value)
|
||||
public function reverseTransform($value): mixed
|
||||
{
|
||||
if ($this->multiple) {
|
||||
if (null === $value | '' === $value) {
|
||||
|
||||
@@ -17,7 +17,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class EntityWorkflowCommentType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('comment', ChillTextareaType::class, [
|
||||
|
||||
@@ -26,7 +26,7 @@ final class LocationFormType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('locationType', EntityType::class, [
|
||||
@@ -63,7 +63,7 @@ final class LocationFormType extends AbstractType
|
||||
/**
|
||||
* @param OptionsResolverInterface $resolver
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => \Chill\MainBundle\Entity\Location::class,
|
||||
@@ -73,7 +73,7 @@ final class LocationFormType extends AbstractType
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'chill_mainbundle_location';
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final class LocationTypeType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder->add(
|
||||
'title',
|
||||
|
||||
@@ -21,7 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class NewsItemType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('title', TextType::class, [
|
||||
@@ -50,7 +50,7 @@ class NewsItemType extends AbstractType
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefault('data_class', NewsItem::class);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class NotificationCommentType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder->add('content', ChillTextareaType::class, [
|
||||
'required' => false,
|
||||
|
||||
@@ -26,7 +26,7 @@ use Symfony\Component\Validator\Constraints\NotNull;
|
||||
|
||||
class NotificationType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('title', TextType::class, [
|
||||
@@ -59,7 +59,7 @@ class NotificationType extends AbstractType
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefault('class', Notification::class);
|
||||
}
|
||||
|
||||
@@ -27,12 +27,12 @@ class PermissionsGroupType extends AbstractType
|
||||
*/
|
||||
protected $flagProviders = [];
|
||||
|
||||
public function addFlagProvider(PermissionsGroupFlagProvider $provider)
|
||||
public function addFlagProvider(PermissionsGroupFlagProvider $provider): void
|
||||
{
|
||||
$this->flagProviders[] = $provider;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name', TextType::class);
|
||||
@@ -53,7 +53,7 @@ class PermissionsGroupType extends AbstractType
|
||||
/**
|
||||
* @param OptionsResolverInterface $resolver
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => \Chill\MainBundle\Entity\PermissionsGroup::class,
|
||||
@@ -63,7 +63,7 @@ class PermissionsGroupType extends AbstractType
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'chill_mainbundle_permissionsgroup';
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class RegroupmentType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name', TextType::class, [
|
||||
@@ -39,7 +39,7 @@ class RegroupmentType extends AbstractType
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver
|
||||
->setDefault('class', Regroupment::class);
|
||||
|
||||
@@ -20,7 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class SavedExportType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('title', TextType::class, [
|
||||
@@ -31,7 +31,7 @@ class SavedExportType extends AbstractType
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'class' => SavedExport::class,
|
||||
|
||||
@@ -19,7 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class ScopeType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name', TranslatableStringFormType::class)
|
||||
@@ -33,7 +33,7 @@ class ScopeType extends AbstractType
|
||||
/**
|
||||
* @param OptionsResolverInterface $resolver
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => \Chill\MainBundle\Entity\Scope::class,
|
||||
@@ -43,7 +43,7 @@ class ScopeType extends AbstractType
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'chill_mainbundle_scope';
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class AddressDateType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add(
|
||||
@@ -30,7 +30,7 @@ class AddressDateType extends AbstractType
|
||||
);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefault('data_class', Address::class);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
*/
|
||||
class AddressType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('street', TextType::class, [
|
||||
@@ -75,7 +75,7 @@ class AddressType extends AbstractType
|
||||
}
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver
|
||||
->setDefault('data_class', Address::class)
|
||||
|
||||
@@ -79,7 +79,7 @@ trait AppendScopeChoiceTypeTrait
|
||||
* - Chill\MainBundle\Entity\Center for center
|
||||
* - Symfony\Component\Security\Core\Role\Role for role
|
||||
*/
|
||||
public function appendScopeChoicesOptions(OptionsResolver $resolver)
|
||||
public function appendScopeChoicesOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver
|
||||
->setRequired(['center', 'role'])
|
||||
|
||||
@@ -27,7 +27,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
*/
|
||||
class ChillCollectionType extends AbstractType
|
||||
{
|
||||
public function buildView(FormView $view, FormInterface $form, array $options)
|
||||
public function buildView(FormView $view, FormInterface $form, array $options): void
|
||||
{
|
||||
$view->vars['button_add_label'] = $options['button_add_label'];
|
||||
$view->vars['button_remove_label'] = $options['button_remove_label'];
|
||||
@@ -39,7 +39,7 @@ class ChillCollectionType extends AbstractType
|
||||
$view->vars['uniqid'] = uniqid();
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver
|
||||
->setDefaults([
|
||||
@@ -52,7 +52,7 @@ class ChillCollectionType extends AbstractType
|
||||
]);
|
||||
}
|
||||
|
||||
public function getParent()
|
||||
public function getParent(): ?string
|
||||
{
|
||||
return \Symfony\Component\Form\Extension\Core\Type\CollectionType::class;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user