mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 15:43:51 +00:00
php cs fixes after updating php cs fixer
This commit is contained in:
@@ -141,7 +141,9 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
return new $class();
|
||||
}
|
||||
|
||||
protected function customizeQuery(string $action, Request $request, $query): void {}
|
||||
protected function customizeQuery(string $action, Request $request, $query): void
|
||||
{
|
||||
}
|
||||
|
||||
protected function getActionConfig(string $action)
|
||||
{
|
||||
|
@@ -224,9 +224,13 @@ class CRUDController extends AbstractController
|
||||
/**
|
||||
* Customize the form created by createFormFor.
|
||||
*/
|
||||
protected function customizeForm(string $action, FormInterface $form) {}
|
||||
protected function customizeForm(string $action, FormInterface $form)
|
||||
{
|
||||
}
|
||||
|
||||
protected function customizeQuery(string $action, Request $request, $query): void {}
|
||||
protected function customizeQuery(string $action, Request $request, $query): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $formClass
|
||||
@@ -840,7 +844,9 @@ class CRUDController extends AbstractController
|
||||
};
|
||||
}
|
||||
|
||||
protected function onFormValid(string $action, object $entity, FormInterface $form, Request $request) {}
|
||||
protected function onFormValid(string $action, object $entity, FormInterface $form, Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
protected function onPostCheckACL($action, Request $request, $entity): ?Response
|
||||
{
|
||||
@@ -852,36 +858,58 @@ class CRUDController extends AbstractController
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function onPostFlush(string $action, $entity, FormInterface $form, Request $request) {}
|
||||
protected function onPostFlush(string $action, $entity, FormInterface $form, Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* method used by indexAction.
|
||||
*/
|
||||
protected function onPostIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, mixed $query) {}
|
||||
protected function onPostIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, mixed $query)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* method used by indexAction.
|
||||
*/
|
||||
protected function onPostIndexFetchQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, mixed $entities) {}
|
||||
protected function onPostIndexFetchQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, mixed $entities)
|
||||
{
|
||||
}
|
||||
|
||||
protected function onPostPersist(string $action, $entity, FormInterface $form, Request $request) {}
|
||||
protected function onPostPersist(string $action, $entity, FormInterface $form, Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
protected function onPostRemove(string $action, $entity, FormInterface $form, Request $request) {}
|
||||
protected function onPostRemove(string $action, $entity, FormInterface $form, Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
protected function onPreDelete(string $action, Request $request) {}
|
||||
protected function onPreDelete(string $action, Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request) {}
|
||||
protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
protected function onPreIndex(string $action, Request $request) {}
|
||||
protected function onPreIndex(string $action, Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* method used by indexAction.
|
||||
*/
|
||||
protected function onPreIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator) {}
|
||||
protected function onPreIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator)
|
||||
{
|
||||
}
|
||||
|
||||
protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request) {}
|
||||
protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
protected function onPreRemove(string $action, $entity, FormInterface $form, Request $request) {}
|
||||
protected function onPreRemove(string $action, $entity, FormInterface $form, Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Add ordering fields in the query build by self::queryEntities.
|
||||
|
@@ -16,4 +16,6 @@ use Symfony\Component\Form\AbstractType;
|
||||
/**
|
||||
* Class CRUDDeleteEntityForm.
|
||||
*/
|
||||
class CRUDDeleteEntityForm extends AbstractType {}
|
||||
class CRUDDeleteEntityForm extends AbstractType
|
||||
{
|
||||
}
|
||||
|
@@ -83,7 +83,7 @@ class LoadAndUpdateLanguagesCommand extends Command
|
||||
$languages = [];
|
||||
|
||||
foreach ($chillAvailableLanguages as $avLang) {
|
||||
$languages[$avLang] = \Symfony\Component\Intl\Languages::getNames();
|
||||
$languages[$avLang] = Languages::getNames();
|
||||
}
|
||||
|
||||
foreach (Languages::getNames() as $code => $lang) {
|
||||
@@ -105,7 +105,7 @@ class LoadAndUpdateLanguagesCommand extends Command
|
||||
$languageDB = $em->getRepository(Language::class)->find($code);
|
||||
|
||||
if (null === $languageDB) {
|
||||
$languageDB = new \Chill\MainBundle\Entity\Language();
|
||||
$languageDB = new Language();
|
||||
$languageDB->setId($code);
|
||||
$em->persist($languageDB);
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ class LoadCountriesCommand extends Command
|
||||
$names[$language] = Countries::getName($code, $language);
|
||||
}
|
||||
|
||||
$country = new \Chill\MainBundle\Entity\Country();
|
||||
$country = new Country();
|
||||
$country->setName($names)->setCountryCode($code);
|
||||
$countryEntities[] = $country;
|
||||
}
|
||||
|
@@ -194,8 +194,14 @@ class LoadPostalCodesCommand extends Command
|
||||
}
|
||||
}
|
||||
|
||||
class ExistingPostalCodeException extends \Exception {}
|
||||
class ExistingPostalCodeException extends \Exception
|
||||
{
|
||||
}
|
||||
|
||||
class CountryCodeNotFoundException extends \Exception {}
|
||||
class CountryCodeNotFoundException extends \Exception
|
||||
{
|
||||
}
|
||||
|
||||
class PostalCodeNotValidException extends \Exception {}
|
||||
class PostalCodeNotValidException extends \Exception
|
||||
{
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ class SetPasswordCommand extends Command
|
||||
public function _getUser($username)
|
||||
{
|
||||
return $this->entityManager
|
||||
->getRepository(\Chill\MainBundle\Entity\User::class)
|
||||
->getRepository(User::class)
|
||||
->findOneBy(['username' => $username]);
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,9 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||
|
||||
final class AddressReferenceAPIController extends ApiController
|
||||
{
|
||||
public function __construct(private readonly AddressReferenceRepository $addressReferenceRepository, private readonly PaginatorFactory $paginatorFactory) {}
|
||||
public function __construct(private readonly AddressReferenceRepository $addressReferenceRepository, private readonly PaginatorFactory $paginatorFactory)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/api/1.0/main/address-reference/by-postal-code/{id}/search.json")
|
||||
|
@@ -23,7 +23,9 @@ use Symfony\Component\Serializer\SerializerInterface;
|
||||
|
||||
class AddressToReferenceMatcherController
|
||||
{
|
||||
public function __construct(private readonly Security $security, private readonly EntityManagerInterface $entityManager, private readonly SerializerInterface $serializer) {}
|
||||
public function __construct(private readonly Security $security, private readonly EntityManagerInterface $entityManager, private readonly SerializerInterface $serializer)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/api/1.0/main/address/reference-match/{id}/set/reviewed", methods={"POST"})
|
||||
|
@@ -70,7 +70,7 @@ class ExportController extends AbstractController
|
||||
*/
|
||||
public function downloadResultAction(Request $request, mixed $alias)
|
||||
{
|
||||
/** @var \Chill\MainBundle\Export\ExportManager $exportManager */
|
||||
/** @var ExportManager $exportManager */
|
||||
$exportManager = $this->exportManager;
|
||||
$export = $exportManager->getExport($alias);
|
||||
$key = $request->query->get('key', null);
|
||||
@@ -108,13 +108,13 @@ class ExportController extends AbstractController
|
||||
*
|
||||
* @param string $alias
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
* @return Response
|
||||
*
|
||||
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/exports/generate/{alias}", name="chill_main_export_generate", methods={"GET"})
|
||||
*/
|
||||
public function generateAction(Request $request, $alias)
|
||||
{
|
||||
/** @var \Chill\MainBundle\Export\ExportManager $exportManager */
|
||||
/** @var ExportManager $exportManager */
|
||||
$exportManager = $this->exportManager;
|
||||
$key = $request->query->get('key', null);
|
||||
$savedExport = $this->getSavedExportFromRequest($request);
|
||||
@@ -274,7 +274,7 @@ class ExportController extends AbstractController
|
||||
*/
|
||||
protected function createCreateFormExport(string $alias, string $step, array $data, ?SavedExport $savedExport): FormInterface
|
||||
{
|
||||
/** @var \Chill\MainBundle\Export\ExportManager $exportManager */
|
||||
/** @var ExportManager $exportManager */
|
||||
$exportManager = $this->exportManager;
|
||||
$isGenerate = str_starts_with($step, 'generate_');
|
||||
|
||||
@@ -444,7 +444,7 @@ class ExportController extends AbstractController
|
||||
*
|
||||
* @param string $alias
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\RedirectResponse
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
private function forwardToGenerate(Request $request, DirectExportInterface|ExportInterface $export, $alias, ?SavedExport $savedExport)
|
||||
{
|
||||
@@ -452,7 +452,7 @@ class ExportController extends AbstractController
|
||||
$dataFormatter = $this->session->get('formatter_step_raw', null);
|
||||
$dataExport = $this->session->get('export_step_raw', null);
|
||||
|
||||
if (null === $dataFormatter && $export instanceof \Chill\MainBundle\Export\ExportInterface) {
|
||||
if (null === $dataFormatter && $export instanceof ExportInterface) {
|
||||
return $this->redirectToRoute('chill_main_export_new', [
|
||||
'alias' => $alias,
|
||||
'step' => $this->getNextStep('generate', $export, true),
|
||||
@@ -531,7 +531,7 @@ class ExportController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
/** @var \Chill\MainBundle\Export\ExportManager $exportManager */
|
||||
/** @var ExportManager $exportManager */
|
||||
$exportManager = $this->exportManager;
|
||||
|
||||
$form = $this->createCreateFormExport($alias, 'centers', [], $savedExport);
|
||||
@@ -620,11 +620,11 @@ class ExportController extends AbstractController
|
||||
return 'export';
|
||||
|
||||
case 'export':
|
||||
if ($export instanceof \Chill\MainBundle\Export\ExportInterface) {
|
||||
if ($export instanceof ExportInterface) {
|
||||
return $reverse ? 'centers' : 'formatter';
|
||||
}
|
||||
|
||||
if ($export instanceof \Chill\MainBundle\Export\DirectExportInterface) {
|
||||
if ($export instanceof DirectExportInterface) {
|
||||
return $reverse ? 'centers' : 'generate';
|
||||
}
|
||||
|
||||
|
@@ -24,7 +24,9 @@ use Symfony\Component\Serializer\SerializerInterface;
|
||||
|
||||
class GeographicalUnitByAddressApiController
|
||||
{
|
||||
public function __construct(private readonly PaginatorFactory $paginatorFactory, private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly Security $security, private readonly SerializerInterface $serializer) {}
|
||||
public function __construct(private readonly PaginatorFactory $paginatorFactory, private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly Security $security, private readonly SerializerInterface $serializer)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/api/1.0/main/geographical-unit/by-address/{id}.{_format}", requirements={"_format": "json"})
|
||||
|
@@ -13,4 +13,6 @@ namespace Chill\MainBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
|
||||
class LocationTypeController extends CRUDController {}
|
||||
class LocationTypeController extends CRUDController
|
||||
{
|
||||
}
|
||||
|
@@ -46,5 +46,7 @@ class LoginController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
public function LoginCheckAction(Request $request) {}
|
||||
public function LoginCheckAction(Request $request)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,9 @@ use Symfony\Component\Serializer\SerializerInterface;
|
||||
*/
|
||||
class NotificationApiController
|
||||
{
|
||||
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly NotificationRepository $notificationRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer) {}
|
||||
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly NotificationRepository $notificationRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{id}/mark/read", name="chill_api_main_notification_mark_read", methods={"POST"})
|
||||
|
@@ -41,7 +41,9 @@ use function in_array;
|
||||
*/
|
||||
class NotificationController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $chillLogger, private readonly LoggerInterface $logger, private readonly Security $security, private readonly NotificationRepository $notificationRepository, private readonly NotificationHandlerManager $notificationHandlerManager, private readonly PaginatorFactory $paginatorFactory, private readonly TranslatorInterface $translator, private readonly UserRepository $userRepository) {}
|
||||
public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $chillLogger, private readonly LoggerInterface $logger, private readonly Security $security, private readonly NotificationRepository $notificationRepository, private readonly NotificationHandlerManager $notificationHandlerManager, private readonly PaginatorFactory $paginatorFactory, private readonly TranslatorInterface $translator, private readonly UserRepository $userRepository)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/create", name="chill_main_notification_create")
|
||||
|
@@ -21,7 +21,9 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
||||
|
||||
class PermissionApiController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly Security $security) {}
|
||||
public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly Security $security)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/api/1.0/main/permissions/info.json", methods={"POST"})
|
||||
|
@@ -47,7 +47,8 @@ final class PermissionsGroupController extends AbstractController
|
||||
private readonly EntityManagerInterface $em,
|
||||
private readonly PermissionsGroupRepository $permissionsGroupRepository,
|
||||
private readonly RoleScopeRepository $roleScopeRepository,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/permissionsgroup/{id}/add_link_role_scope", name="admin_permissionsgroup_add_role_scope", methods={"PUT"})
|
||||
|
@@ -26,7 +26,9 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||
|
||||
final class PostalCodeAPIController extends ApiController
|
||||
{
|
||||
public function __construct(private readonly CountryRepository $countryRepository, private readonly PostalCodeRepositoryInterface $postalCodeRepository, private readonly PaginatorFactory $paginatorFactory) {}
|
||||
public function __construct(private readonly CountryRepository $countryRepository, private readonly PostalCodeRepositoryInterface $postalCodeRepository, private readonly PaginatorFactory $paginatorFactory)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/api/1.0/main/postal-code/search.json")
|
||||
|
@@ -34,7 +34,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class SavedExportController
|
||||
{
|
||||
public function __construct(private readonly \Twig\Environment $templating, private readonly EntityManagerInterface $entityManager, private readonly ExportManager $exportManager, private readonly FormFactoryInterface $formFactory, private readonly SavedExportRepositoryInterface $savedExportRepository, private readonly Security $security, private readonly SessionInterface $session, private readonly TranslatorInterface $translator, private readonly UrlGeneratorInterface $urlGenerator) {}
|
||||
public function __construct(private readonly \Twig\Environment $templating, private readonly EntityManagerInterface $entityManager, private readonly ExportManager $exportManager, private readonly FormFactoryInterface $formFactory, private readonly SavedExportRepositoryInterface $savedExportRepository, private readonly Security $security, private readonly SessionInterface $session, private readonly TranslatorInterface $translator, private readonly UrlGeneratorInterface $urlGenerator)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/exports/saved/{id}/delete", name="chill_main_export_saved_delete")
|
||||
|
@@ -56,7 +56,7 @@ class ScopeController extends AbstractController
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$scope = $em->getRepository(\Chill\MainBundle\Entity\Scope::class)->find($id);
|
||||
$scope = $em->getRepository(Scope::class)->find($id);
|
||||
|
||||
if (!$scope) {
|
||||
throw $this->createNotFoundException('Unable to find Scope entity.');
|
||||
@@ -79,7 +79,7 @@ class ScopeController extends AbstractController
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$entities = $em->getRepository(\Chill\MainBundle\Entity\Scope::class)->findAll();
|
||||
$entities = $em->getRepository(Scope::class)->findAll();
|
||||
|
||||
return $this->render('@ChillMain/Scope/index.html.twig', [
|
||||
'entities' => $entities,
|
||||
@@ -109,7 +109,7 @@ class ScopeController extends AbstractController
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$scope = $em->getRepository(\Chill\MainBundle\Entity\Scope::class)->find($id);
|
||||
$scope = $em->getRepository(Scope::class)->find($id);
|
||||
|
||||
if (!$scope) {
|
||||
throw $this->createNotFoundException('Unable to find Scope entity.');
|
||||
@@ -129,7 +129,7 @@ class ScopeController extends AbstractController
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$scope = $em->getRepository(\Chill\MainBundle\Entity\Scope::class)->find($id);
|
||||
$scope = $em->getRepository(Scope::class)->find($id);
|
||||
|
||||
if (!$scope) {
|
||||
throw $this->createNotFoundException('Unable to find Scope entity.');
|
||||
|
@@ -32,7 +32,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*/
|
||||
class SearchController extends AbstractController
|
||||
{
|
||||
public function __construct(protected SearchProvider $searchProvider, protected TranslatorInterface $translator, protected PaginatorFactory $paginatorFactory, protected SearchApi $searchApi) {}
|
||||
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")
|
||||
@@ -45,7 +47,7 @@ class SearchController extends AbstractController
|
||||
/** @var Chill\MainBundle\Search\HasAdvancedSearchFormInterface $variable */
|
||||
$search = $this->searchProvider
|
||||
->getHasAdvancedFormByName($name);
|
||||
} catch (\Chill\MainBundle\Search\UnknowSearchNameException) {
|
||||
} catch (UnknowSearchNameException) {
|
||||
throw $this->createNotFoundException('no advanced search for '."{$name}");
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,9 @@ use Symfony\Component\Security\Core\Security;
|
||||
|
||||
class TimelineCenterController extends AbstractController
|
||||
{
|
||||
public function __construct(protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory, private readonly Security $security) {}
|
||||
public function __construct(protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory, private readonly Security $security)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/center/timeline",
|
||||
|
@@ -38,7 +38,9 @@ class UserController extends CRUDController
|
||||
{
|
||||
final public const FORM_GROUP_CENTER_COMPOSED = 'composed_groupcenter';
|
||||
|
||||
public function __construct(private readonly LoggerInterface $logger, private readonly ValidatorInterface $validator, private readonly UserPasswordEncoderInterface $passwordEncoder, private readonly UserRepository $userRepository, protected ParameterBagInterface $parameterBag, private readonly TranslatorInterface $translator) {}
|
||||
public function __construct(private readonly LoggerInterface $logger, private readonly ValidatorInterface $validator, private readonly UserPasswordEncoderInterface $passwordEncoder, private readonly UserRepository $userRepository, protected ParameterBagInterface $parameterBag, private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/admin/main/user/{uid}/add_link_groupcenter",
|
||||
@@ -48,7 +50,7 @@ class UserController extends CRUDController
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$user = $em->getRepository(\Chill\MainBundle\Entity\User::class)->find($uid);
|
||||
$user = $em->getRepository(User::class)->find($uid);
|
||||
|
||||
if (!$user) {
|
||||
throw $this->createNotFoundException('Unable to find User entity.');
|
||||
@@ -100,13 +102,13 @@ class UserController extends CRUDController
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$user = $em->getRepository(\Chill\MainBundle\Entity\User::class)->find($uid);
|
||||
$user = $em->getRepository(User::class)->find($uid);
|
||||
|
||||
if (!$user) {
|
||||
throw $this->createNotFoundException('Unable to find User entity.');
|
||||
}
|
||||
|
||||
$groupCenter = $em->getRepository(\Chill\MainBundle\Entity\GroupCenter::class)
|
||||
$groupCenter = $em->getRepository(GroupCenter::class)
|
||||
->find($gcid);
|
||||
|
||||
if (!$groupCenter) {
|
||||
@@ -424,7 +426,7 @@ class UserController extends CRUDController
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$groupCenterManaged = $em->getRepository(\Chill\MainBundle\Entity\GroupCenter::class)
|
||||
$groupCenterManaged = $em->getRepository(GroupCenter::class)
|
||||
->findOneBy([
|
||||
'center' => $groupCenter->getCenter(),
|
||||
'permissionsGroup' => $groupCenter->getPermissionsGroup(),
|
||||
|
@@ -27,7 +27,8 @@ final readonly class UserExportController
|
||||
private UserRepositoryInterface $userRepository,
|
||||
private Security $security,
|
||||
private TranslatorInterface $translator,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \League\Csv\CannotInsertRecord
|
||||
|
@@ -21,7 +21,8 @@ class UserJobScopeHistoriesController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly Environment $engine,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/admin/main/user/{id}/job-scope-history", name="admin_user_job_scope_history")
|
||||
|
@@ -24,7 +24,8 @@ class UserProfileController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly TranslatorInterface $translator,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* User profile that allows editing of phonenumber and visualization of certain data.
|
||||
|
@@ -29,7 +29,9 @@ use Symfony\Component\Serializer\SerializerInterface;
|
||||
|
||||
class WorkflowApiController
|
||||
{
|
||||
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer) {}
|
||||
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list of workflow which are waiting an action for the user.
|
||||
|
@@ -38,7 +38,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class WorkflowController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly ValidatorInterface $validator, private readonly PaginatorFactory $paginatorFactory, private readonly Registry $registry, private readonly EntityManagerInterface $entityManager, private readonly TranslatorInterface $translator, private readonly Security $security) {}
|
||||
public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly ValidatorInterface $validator, private readonly PaginatorFactory $paginatorFactory, private readonly Registry $registry, private readonly EntityManagerInterface $entityManager, private readonly TranslatorInterface $translator, private readonly Security $security)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/main/workflow/create", name="chill_main_workflow_create")
|
||||
|
@@ -55,7 +55,8 @@ final readonly class CronManager implements CronManagerInterface
|
||||
private EntityManagerInterface $entityManager,
|
||||
private iterable $jobs,
|
||||
private LoggerInterface $logger
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function run(string $forceJob = null): void
|
||||
{
|
||||
|
@@ -570,7 +570,7 @@ class ChillMainExtension extends Extension implements
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => \Chill\MainBundle\Entity\UserJob::class,
|
||||
'class' => UserJob::class,
|
||||
'name' => 'user_job',
|
||||
'base_path' => '/api/1.0/main/user-job',
|
||||
'base_role' => 'ROLE_USER',
|
||||
@@ -634,7 +634,7 @@ class ChillMainExtension extends Extension implements
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => \Chill\MainBundle\Entity\Country::class,
|
||||
'class' => Country::class,
|
||||
'name' => 'country',
|
||||
'base_path' => '/api/1.0/main/country',
|
||||
'base_role' => 'ROLE_USER',
|
||||
@@ -654,7 +654,7 @@ class ChillMainExtension extends Extension implements
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => \Chill\MainBundle\Entity\User::class,
|
||||
'class' => User::class,
|
||||
'controller' => \Chill\MainBundle\Controller\UserApiController::class,
|
||||
'name' => 'user',
|
||||
'base_path' => '/api/1.0/main/user',
|
||||
@@ -696,7 +696,7 @@ class ChillMainExtension extends Extension implements
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => \Chill\MainBundle\Entity\Location::class,
|
||||
'class' => Location::class,
|
||||
'controller' => \Chill\MainBundle\Controller\LocationApiController::class,
|
||||
'name' => 'location',
|
||||
'base_path' => '/api/1.0/main/location',
|
||||
@@ -718,7 +718,7 @@ class ChillMainExtension extends Extension implements
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => \Chill\MainBundle\Entity\LocationType::class,
|
||||
'class' => LocationType::class,
|
||||
'controller' => \Chill\MainBundle\Controller\LocationTypeApiController::class,
|
||||
'name' => 'location_type',
|
||||
'base_path' => '/api/1.0/main/location-type',
|
||||
@@ -739,7 +739,7 @@ class ChillMainExtension extends Extension implements
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => \Chill\MainBundle\Entity\Civility::class,
|
||||
'class' => Civility::class,
|
||||
'name' => 'civility',
|
||||
'base_path' => '/api/1.0/main/civility',
|
||||
'base_role' => 'ROLE_USER',
|
||||
|
@@ -21,7 +21,9 @@ use Symfony\Component\Security\Core\Security;
|
||||
|
||||
class TrackCreateUpdateSubscriber implements EventSubscriber
|
||||
{
|
||||
public function __construct(private readonly Security $security) {}
|
||||
public function __construct(private readonly Security $security)
|
||||
{
|
||||
}
|
||||
|
||||
public function getSubscribedEvents()
|
||||
{
|
||||
|
@@ -15,7 +15,9 @@ class Point implements \JsonSerializable
|
||||
{
|
||||
public static string $SRID = '4326';
|
||||
|
||||
private function __construct(private readonly ?float $lon, private readonly ?float $lat) {}
|
||||
private function __construct(private readonly ?float $lon, private readonly ?float $lat)
|
||||
{
|
||||
}
|
||||
|
||||
public static function fromArrayGeoJson(array $array): self
|
||||
{
|
||||
|
@@ -53,5 +53,6 @@ class SimpleGeographicalUnitDTO
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
public int $layerId
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
@@ -73,8 +73,8 @@ class PermissionsGroup
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->roleScopes = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->groupCenters = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->roleScopes = new ArrayCollection();
|
||||
$this->groupCenters = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function addRoleScope(RoleScope $roleScope)
|
||||
|
@@ -188,7 +188,7 @@ class User implements UserInterface, \Stringable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Chill\MainBundle\Entity\User
|
||||
* @return User
|
||||
*/
|
||||
public function addGroupCenter(GroupCenter $groupCenter)
|
||||
{
|
||||
@@ -197,7 +197,9 @@ class User implements UserInterface, \Stringable
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function eraseCredentials() {}
|
||||
public function eraseCredentials()
|
||||
{
|
||||
}
|
||||
|
||||
public function getAbsenceStart(): ?\DateTimeImmutable
|
||||
{
|
||||
|
@@ -26,7 +26,8 @@ final readonly class ExportFormHelper
|
||||
private AuthorizationHelperForCurrentUserInterface $authorizationHelper,
|
||||
private ExportManager $exportManager,
|
||||
private FormFactoryInterface $formFactory,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function getDefaultData(string $step, DirectExportInterface|ExportInterface $export, array $options = []): array
|
||||
{
|
||||
|
@@ -100,7 +100,7 @@ class CSVListFormatter implements FormatterInterface
|
||||
* @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data
|
||||
* @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response The response to be shown
|
||||
* @return Response The response to be shown
|
||||
*/
|
||||
public function getResponse(
|
||||
$result,
|
||||
|
@@ -99,7 +99,7 @@ class CSVPivotedListFormatter implements FormatterInterface
|
||||
* @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data
|
||||
* @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response The response to be shown
|
||||
* @return Response The response to be shown
|
||||
*/
|
||||
public function getResponse(
|
||||
$result,
|
||||
|
@@ -112,7 +112,7 @@ class SpreadsheetListFormatter implements FormatterInterface
|
||||
* @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data
|
||||
* @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response The response to be shown
|
||||
* @return Response The response to be shown
|
||||
*/
|
||||
public function getResponse(
|
||||
$result,
|
||||
|
@@ -15,7 +15,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class DateTimeHelper
|
||||
{
|
||||
public function __construct(private readonly TranslatorInterface $translator) {}
|
||||
public function __construct(private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
public function getLabel($header): callable
|
||||
{
|
||||
|
@@ -79,7 +79,9 @@ class ExportAddressHelper
|
||||
*/
|
||||
private ?array $unitRefsKeysCache = [];
|
||||
|
||||
public function __construct(private readonly AddressRender $addressRender, private readonly AddressRepository $addressRepository, private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
|
||||
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')
|
||||
{
|
||||
|
@@ -21,7 +21,9 @@ use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||
*/
|
||||
class TranslatableStringExportLabelHelper
|
||||
{
|
||||
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
|
||||
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
public function getLabel(string $key, array $values, string $header)
|
||||
{
|
||||
|
@@ -16,7 +16,9 @@ use Chill\MainBundle\Templating\Entity\UserRender;
|
||||
|
||||
class UserHelper
|
||||
{
|
||||
public function __construct(private readonly UserRender $userRender, private readonly UserRepositoryInterface $userRepository) {}
|
||||
public function __construct(private readonly UserRender $userRender, private readonly UserRepositoryInterface $userRepository)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a callable that will transform a value into a string representing a user.
|
||||
|
@@ -20,4 +20,6 @@ namespace Chill\MainBundle\Export;
|
||||
*
|
||||
* When used, the `ExportManager` will not handle aggregator for this class.
|
||||
*/
|
||||
interface ListInterface extends ExportInterface {}
|
||||
interface ListInterface extends ExportInterface
|
||||
{
|
||||
}
|
||||
|
@@ -17,7 +17,8 @@ final readonly class SortExportElement
|
||||
{
|
||||
public function __construct(
|
||||
private TranslatorInterface $translator,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int|string, FilterInterface> $elements
|
||||
|
@@ -19,7 +19,9 @@ use Symfony\Component\Security\Core\Security;
|
||||
|
||||
final class PrivateCommentDataMapper extends AbstractType implements DataMapperInterface
|
||||
{
|
||||
public function __construct(private readonly Security $security) {}
|
||||
public function __construct(private readonly Security $security)
|
||||
{
|
||||
}
|
||||
|
||||
public function mapDataToForms($viewData, $forms)
|
||||
{
|
||||
|
@@ -16,7 +16,9 @@ use Symfony\Component\Form\DataMapperInterface;
|
||||
|
||||
class ScopePickerDataMapper implements DataMapperInterface
|
||||
{
|
||||
public function __construct(private readonly ?Scope $scope = null) {}
|
||||
public function __construct(private readonly ?Scope $scope = null)
|
||||
{
|
||||
}
|
||||
|
||||
public function mapDataToForms($data, $forms)
|
||||
{
|
||||
|
@@ -17,7 +17,9 @@ class CustomizeFormEvent extends \Symfony\Contracts\EventDispatcher\Event
|
||||
{
|
||||
final public const NAME = 'chill_main.customize_form';
|
||||
|
||||
public function __construct(protected string $type, protected FormBuilderInterface $builder) {}
|
||||
public function __construct(protected string $type, protected FormBuilderInterface $builder)
|
||||
{
|
||||
}
|
||||
|
||||
public function getBuilder(): FormBuilderInterface
|
||||
{
|
||||
|
@@ -24,7 +24,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
final class LocationFormType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -83,7 +83,7 @@ trait AppendScopeChoiceTypeTrait
|
||||
{
|
||||
$resolver
|
||||
->setRequired(['center', 'role'])
|
||||
->setAllowedTypes('center', \Chill\MainBundle\Entity\Center::class)
|
||||
->setAllowedTypes('center', Center::class)
|
||||
->setAllowedTypes('role', 'string');
|
||||
}
|
||||
|
||||
|
@@ -23,10 +23,10 @@ class ComposedGroupCenterType extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('permissionsgroup', EntityType::class, [
|
||||
'class' => \Chill\MainBundle\Entity\PermissionsGroup::class,
|
||||
'class' => PermissionsGroup::class,
|
||||
'choice_label' => static fn (PermissionsGroup $group) => $group->getName(),
|
||||
])->add('center', EntityType::class, [
|
||||
'class' => \Chill\MainBundle\Entity\Center::class,
|
||||
'class' => Center::class,
|
||||
'choice_label' => static fn (Center $center) => $center->getName(),
|
||||
]);
|
||||
}
|
||||
|
@@ -17,7 +17,9 @@ use Symfony\Component\Form\Exception\TransformationFailedException;
|
||||
|
||||
final readonly class AddressToIdDataTransformer implements DataTransformerInterface
|
||||
{
|
||||
public function __construct(private AddressRepository $addressRepository) {}
|
||||
public function __construct(private AddressRepository $addressRepository)
|
||||
{
|
||||
}
|
||||
|
||||
public function reverseTransform($value)
|
||||
{
|
||||
|
@@ -20,7 +20,9 @@ use Symfony\Component\Form\Exception\UnexpectedTypeException;
|
||||
|
||||
class CenterTransformer implements DataTransformerInterface
|
||||
{
|
||||
public function __construct(private readonly CenterRepository $centerRepository, private readonly bool $multiple = false) {}
|
||||
public function __construct(private readonly CenterRepository $centerRepository, private readonly bool $multiple = false)
|
||||
{
|
||||
}
|
||||
|
||||
public function reverseTransform($id)
|
||||
{
|
||||
|
@@ -22,7 +22,9 @@ use Symfony\Component\Serializer\SerializerInterface;
|
||||
|
||||
class EntityToJsonTransformer implements DataTransformerInterface
|
||||
{
|
||||
public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly bool $multiple, private readonly string $type) {}
|
||||
public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly bool $multiple, private readonly string $type)
|
||||
{
|
||||
}
|
||||
|
||||
public function reverseTransform($value)
|
||||
{
|
||||
|
@@ -17,7 +17,9 @@ use Symfony\Component\Form\DataTransformerInterface;
|
||||
|
||||
class MultipleObjectsToIdTransformer implements DataTransformerInterface
|
||||
{
|
||||
public function __construct(private readonly EntityManagerInterface $em, private readonly ?string $class = null) {}
|
||||
public function __construct(private readonly EntityManagerInterface $em, private readonly ?string $class = null)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms a string (id) to an object (item).
|
||||
|
@@ -17,7 +17,9 @@ use Symfony\Component\Form\Exception\TransformationFailedException;
|
||||
|
||||
class ObjectToIdTransformer implements DataTransformerInterface
|
||||
{
|
||||
public function __construct(private readonly EntityManagerInterface $em, private readonly ?string $class = null) {}
|
||||
public function __construct(private readonly EntityManagerInterface $em, private readonly ?string $class = null)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms a string (id) to an object.
|
||||
|
@@ -18,7 +18,9 @@ use Symfony\Component\Form\Exception\TransformationFailedException;
|
||||
|
||||
class PostalCodeToIdTransformer implements DataTransformerInterface
|
||||
{
|
||||
public function __construct(private readonly PostalCodeRepositoryInterface $postalCodeRepository) {}
|
||||
public function __construct(private readonly PostalCodeRepositoryInterface $postalCodeRepository)
|
||||
{
|
||||
}
|
||||
|
||||
public function reverseTransform($value)
|
||||
{
|
||||
|
@@ -18,7 +18,9 @@ use Symfony\Component\Form\Exception\TransformationFailedException;
|
||||
|
||||
class ScopeTransformer implements DataTransformerInterface
|
||||
{
|
||||
public function __construct(private readonly EntityManagerInterface $em) {}
|
||||
public function __construct(private readonly EntityManagerInterface $em)
|
||||
{
|
||||
}
|
||||
|
||||
public function reverseTransform($id)
|
||||
{
|
||||
|
@@ -19,7 +19,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class AggregatorType extends AbstractType
|
||||
{
|
||||
public function __construct() {}
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -29,7 +29,9 @@ class ExportType extends AbstractType
|
||||
|
||||
final public const PICK_FORMATTER_KEY = 'pick_formatter';
|
||||
|
||||
public function __construct(private readonly ExportManager $exportManager, private readonly SortExportElement $sortExportElement) {}
|
||||
public function __construct(private readonly ExportManager $exportManager, private readonly SortExportElement $sortExportElement)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -22,7 +22,9 @@ class FilterType extends AbstractType
|
||||
{
|
||||
final public const ENABLED_FIELD = 'enabled';
|
||||
|
||||
public function __construct() {}
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -33,7 +33,8 @@ final class PickCenterType extends AbstractType
|
||||
private readonly ExportManager $exportManager,
|
||||
private readonly RegroupmentRepository $regroupmentRepository,
|
||||
private readonly AuthorizationHelperForCurrentUserInterface $authorizationHelper
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -41,7 +41,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*/
|
||||
final class PickAddressType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly AddressToIdDataTransformer $addressToIdDataTransformer, private readonly TranslatorInterface $translator) {}
|
||||
public function __construct(private readonly AddressToIdDataTransformer $addressToIdDataTransformer, private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -34,7 +34,9 @@ use function count;
|
||||
*/
|
||||
class PickCenterType extends AbstractType
|
||||
{
|
||||
public function __construct(protected AuthorizationHelperInterface $authorizationHelper, protected Security $security, protected CenterRepository $centerRepository) {}
|
||||
public function __construct(protected AuthorizationHelperInterface $authorizationHelper, protected Security $security, protected CenterRepository $centerRepository)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* add a data transformer if user can reach only one center.
|
||||
|
@@ -21,7 +21,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PickCivilityType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
|
@@ -19,7 +19,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PickLocationTypeType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
|
@@ -21,7 +21,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PickPostalCodeType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly PostalCodeToIdTransformer $postalCodeToIdTransformer) {}
|
||||
public function __construct(private readonly PostalCodeToIdTransformer $postalCodeToIdTransformer)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -27,7 +27,9 @@ use Symfony\Component\Serializer\SerializerInterface;
|
||||
*/
|
||||
class PickUserDynamicType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer) {}
|
||||
public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -20,7 +20,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PickUserLocationType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly LocationRepository $locationRepository) {}
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly LocationRepository $locationRepository)
|
||||
{
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
|
@@ -21,7 +21,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PrivateCommentType extends AbstractType
|
||||
{
|
||||
public function __construct(protected PrivateCommentDataMapper $dataMapper) {}
|
||||
public function __construct(protected PrivateCommentDataMapper $dataMapper)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -39,7 +39,9 @@ use Symfony\Component\Security\Core\Security;
|
||||
*/
|
||||
class ScopePickerType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
|
||||
public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -26,7 +26,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
*/
|
||||
class Select2CountryType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) {}
|
||||
public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
@@ -56,7 +58,7 @@ class Select2CountryType extends AbstractType
|
||||
asort($choices, \SORT_STRING | \SORT_FLAG_CASE);
|
||||
|
||||
$resolver->setDefaults([
|
||||
'class' => \Chill\MainBundle\Entity\Country::class,
|
||||
'class' => Country::class,
|
||||
'choices' => array_combine(array_values($choices), array_keys($choices)),
|
||||
'preferred_choices' => array_combine(array_values($preferredChoices), array_keys($preferredChoices)),
|
||||
]);
|
||||
|
@@ -26,7 +26,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
*/
|
||||
class Select2LanguageType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) {}
|
||||
public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
@@ -52,7 +54,7 @@ class Select2LanguageType extends AbstractType
|
||||
asort($choices, \SORT_STRING | \SORT_FLAG_CASE);
|
||||
|
||||
$resolver->setDefaults([
|
||||
'class' => \Chill\MainBundle\Entity\Language::class,
|
||||
'class' => Language::class,
|
||||
'choices' => array_combine(array_values($choices), array_keys($choices)),
|
||||
'preferred_choices' => array_combine(array_values($preferredChoices), array_keys($preferredChoices)),
|
||||
]);
|
||||
|
@@ -36,7 +36,9 @@ use Symfony\Component\Validator\Constraints\Regex;
|
||||
|
||||
class UserType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) {}
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -34,11 +34,13 @@ use Symfony\Component\Workflow\Transition;
|
||||
|
||||
class WorkflowStepType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Registry $registry, private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
|
||||
public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Registry $registry, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
/** @var \Chill\MainBundle\Entity\Workflow\EntityWorkflow $entityWorkflow */
|
||||
/** @var EntityWorkflow $entityWorkflow */
|
||||
$entityWorkflow = $options['entity_workflow'];
|
||||
$handler = $this->entityWorkflowManager->getHandler($entityWorkflow);
|
||||
$workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());
|
||||
|
@@ -23,7 +23,9 @@ use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
final readonly class NotificationByUserCounter implements NotificationCounterInterface
|
||||
{
|
||||
public function __construct(private CacheItemPoolInterface $cacheItemPool, private NotificationRepository $notificationRepository) {}
|
||||
public function __construct(private CacheItemPoolInterface $cacheItemPool, private NotificationRepository $notificationRepository)
|
||||
{
|
||||
}
|
||||
|
||||
public function addNotification(UserInterface $u): int
|
||||
{
|
||||
|
@@ -24,7 +24,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class NotificationMailer
|
||||
{
|
||||
public function __construct(private readonly MailerInterface $mailer, private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator) {}
|
||||
public function __construct(private readonly MailerInterface $mailer, private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
public function postPersistComment(NotificationComment $comment, PostPersistEventArgs $eventArgs): void
|
||||
{
|
||||
|
@@ -18,7 +18,9 @@ use Symfony\Component\HttpKernel\Event\TerminateEvent;
|
||||
|
||||
class PersistNotificationOnTerminateEventSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
public function __construct(private readonly EntityManagerInterface $em, private readonly NotificationPersisterInterface $persister) {}
|
||||
public function __construct(private readonly EntityManagerInterface $em, private readonly NotificationPersisterInterface $persister)
|
||||
{
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
|
@@ -11,4 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Notification\Exception;
|
||||
|
||||
class NotificationHandlerNotFound extends \RuntimeException {}
|
||||
class NotificationHandlerNotFound extends \RuntimeException
|
||||
{
|
||||
}
|
||||
|
@@ -34,7 +34,9 @@ class Mailer
|
||||
*
|
||||
* @param mixed[] $routeParameters
|
||||
*/
|
||||
public function __construct(private readonly MailerInterface $mailer, private readonly LoggerInterface $logger, private readonly Environment $twig, private readonly RouterInterface $router, private readonly TranslatorInterface $translator, protected $routeParameters) {}
|
||||
public function __construct(private readonly MailerInterface $mailer, private readonly LoggerInterface $logger, private readonly Environment $twig, private readonly RouterInterface $router, private readonly TranslatorInterface $translator, protected $routeParameters)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
|
@@ -17,7 +17,9 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
final readonly class NotificationHandlerManager
|
||||
{
|
||||
public function __construct(private iterable $handlers, private EntityManagerInterface $em) {}
|
||||
public function __construct(private iterable $handlers, private EntityManagerInterface $em)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @throw NotificationHandlerNotFound if handler is not found
|
||||
|
@@ -23,7 +23,9 @@ class NotificationPresence
|
||||
{
|
||||
private array $cache = [];
|
||||
|
||||
public function __construct(private readonly Security $security, private readonly NotificationRepository $notificationRepository) {}
|
||||
public function __construct(private readonly Security $security, private readonly NotificationRepository $notificationRepository)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<array{relatedEntityClass: class-string, relatedEntityId: int}> $more
|
||||
|
@@ -21,7 +21,9 @@ use Twig\Extension\RuntimeExtensionInterface;
|
||||
|
||||
class NotificationTwigExtensionRuntime implements RuntimeExtensionInterface
|
||||
{
|
||||
public function __construct(private readonly FormFactoryInterface $formFactory, private readonly NotificationPresence $notificationPresence, private readonly UrlGeneratorInterface $urlGenerator) {}
|
||||
public function __construct(private readonly FormFactoryInterface $formFactory, private readonly NotificationPresence $notificationPresence, private readonly UrlGeneratorInterface $urlGenerator)
|
||||
{
|
||||
}
|
||||
|
||||
public function counterNotificationFor(Environment $environment, string $relatedEntityClass, int $relatedEntityId, array $more = [], array $options = []): string
|
||||
{
|
||||
|
@@ -18,7 +18,9 @@ class PageGenerator implements \Iterator
|
||||
{
|
||||
protected int $current = 1;
|
||||
|
||||
public function __construct(protected Paginator $paginator) {}
|
||||
public function __construct(protected Paginator $paginator)
|
||||
{
|
||||
}
|
||||
|
||||
public function current(): Page
|
||||
{
|
||||
|
@@ -57,7 +57,8 @@ class Paginator implements PaginatorInterface
|
||||
* the key in the GET parameter to indicate the number of item per page.
|
||||
*/
|
||||
protected string $itemPerPageKey
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
@@ -137,7 +138,7 @@ class Paginator implements PaginatorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Chill\MainBundle\Pagination\Page
|
||||
* @return Page
|
||||
*
|
||||
* @throws \RuntimeException if the next page does not exists
|
||||
*/
|
||||
|
@@ -42,7 +42,8 @@ class PaginatorFactory
|
||||
* the request or inside the paginator.
|
||||
*/
|
||||
private $itemPerPage = 20
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* create a paginator instance.
|
||||
|
@@ -16,7 +16,9 @@ use Twig\TwigFilter;
|
||||
|
||||
class Templating extends AbstractExtension
|
||||
{
|
||||
public function __construct(protected PhonenumberHelper $phonenumberHelper) {}
|
||||
public function __construct(protected PhonenumberHelper $phonenumberHelper)
|
||||
{
|
||||
}
|
||||
|
||||
public function formatPhonenumber($phonenumber)
|
||||
{
|
||||
|
@@ -16,4 +16,6 @@ use Redis;
|
||||
/**
|
||||
* Redis client configured by chill main.
|
||||
*/
|
||||
class ChillRedis extends \Redis {}
|
||||
class ChillRedis extends \Redis
|
||||
{
|
||||
}
|
||||
|
@@ -19,7 +19,9 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
class UserACLAwareRepository implements UserACLAwareRepositoryInterface
|
||||
{
|
||||
public function __construct(private readonly ParentRoleHelper $parentRoleHelper, private readonly EntityManagerInterface $em) {}
|
||||
public function __construct(private readonly ParentRoleHelper $parentRoleHelper, private readonly EntityManagerInterface $em)
|
||||
{
|
||||
}
|
||||
|
||||
public function findUsersByReachedACL(string $role, $center, $scope = null, bool $onlyEnabled = true): array
|
||||
{
|
||||
|
@@ -26,7 +26,9 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface
|
||||
/**
|
||||
* SectionMenuBuilder constructor.
|
||||
*/
|
||||
public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator, protected ParameterBagInterface $parameterBag) {}
|
||||
public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator, protected ParameterBagInterface $parameterBag)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
|
@@ -22,7 +22,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
public function __construct(private readonly NotificationByUserCounter $notificationByUserCounter, private readonly WorkflowByUserCounter $workflowByUserCounter, private readonly Security $security, private readonly TranslatorInterface $translator, protected ParameterBagInterface $parameterBag, private readonly RequestStack $requestStack) {}
|
||||
public function __construct(private readonly NotificationByUserCounter $notificationByUserCounter, private readonly WorkflowByUserCounter $workflowByUserCounter, private readonly Security $security, private readonly TranslatorInterface $translator, protected ParameterBagInterface $parameterBag, private readonly RequestStack $requestStack)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, \Knp\Menu\MenuItem $menu, array $parameters)
|
||||
{
|
||||
|
@@ -29,7 +29,9 @@ class MenuComposer
|
||||
|
||||
private RouteCollection $routeCollection;
|
||||
|
||||
public function __construct(private readonly RouterInterface $router, private readonly FactoryInterface $menuFactory, private readonly TranslatorInterface $translator) {}
|
||||
public function __construct(private readonly RouterInterface $router, private readonly FactoryInterface $menuFactory, private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
public function addLocalMenuBuilder(LocalMenuBuilderInterface $menuBuilder, $menuId)
|
||||
{
|
||||
|
@@ -35,7 +35,9 @@ class MenuTwig extends AbstractExtension implements ContainerAwareInterface
|
||||
'activeRouteKey' => null,
|
||||
];
|
||||
|
||||
public function __construct(private readonly MenuComposer $menuComposer) {}
|
||||
public function __construct(private readonly MenuComposer $menuComposer)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a Menu corresponding to $menuId.
|
||||
|
@@ -17,7 +17,9 @@ use Chill\MainBundle\Search\SearchApiQuery;
|
||||
|
||||
class SearchUserApiProvider implements SearchApiInterface
|
||||
{
|
||||
public function __construct(private readonly UserRepository $userRepository) {}
|
||||
public function __construct(private readonly UserRepository $userRepository)
|
||||
{
|
||||
}
|
||||
|
||||
public function getResult(string $key, array $metadata, float $pertinence)
|
||||
{
|
||||
|
@@ -19,7 +19,8 @@ class Result
|
||||
* mixed an arbitrary result.
|
||||
*/
|
||||
private $result
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function getRelevance(): float
|
||||
{
|
||||
|
@@ -11,4 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Search;
|
||||
|
||||
class ParsingException extends \Exception {}
|
||||
class ParsingException extends \Exception
|
||||
{
|
||||
}
|
||||
|
@@ -20,7 +20,9 @@ use Doctrine\ORM\Query\ResultSetMappingBuilder;
|
||||
|
||||
class SearchApi
|
||||
{
|
||||
public function __construct(private readonly EntityManagerInterface $em, private readonly iterable $providers, private readonly PaginatorFactory $paginator) {}
|
||||
public function __construct(private readonly EntityManagerInterface $em, private readonly iterable $providers, private readonly PaginatorFactory $paginator)
|
||||
{
|
||||
}
|
||||
|
||||
public function getResults(string $pattern, array $types, array $parameters): Collection
|
||||
{
|
||||
|
@@ -17,7 +17,9 @@ class SearchApiResult
|
||||
{
|
||||
private mixed $result;
|
||||
|
||||
public function __construct(private readonly float $relevance) {}
|
||||
public function __construct(private readonly float $relevance)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Serializer\Groups({"read"})
|
||||
|
@@ -13,7 +13,9 @@ namespace Chill\MainBundle\Search\Utils;
|
||||
|
||||
class SearchExtractionResult
|
||||
{
|
||||
public function __construct(private readonly string $filteredSubject, private readonly array $found) {}
|
||||
public function __construct(private readonly string $filteredSubject, private readonly array $found)
|
||||
{
|
||||
}
|
||||
|
||||
public function getFilteredSubject(): string
|
||||
{
|
||||
|
@@ -18,4 +18,6 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter;
|
||||
*
|
||||
* This abstract Voter provide generic methods to handle object specific to Chill
|
||||
*/
|
||||
abstract class AbstractChillVoter extends Voter implements ChillVoterInterface {}
|
||||
abstract class AbstractChillVoter extends Voter implements ChillVoterInterface
|
||||
{
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user