mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-06 21:39:42 +00:00
fixes after merge of master into upgrade-sf4
This commit is contained in:
@@ -18,10 +18,13 @@ use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
use Doctrine\DBAL\LockMode;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\OptimisticLockException;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\ConflictHttpException;
|
||||
use Symfony\Component\Serializer\SerializerInterface;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
@@ -36,7 +39,7 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
*/
|
||||
protected array $crudConfig = [];
|
||||
|
||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||
public function __construct(private readonly ManagerRegistry $managerRegistry) {}
|
||||
|
||||
/**
|
||||
* get the role given from the config.
|
||||
@@ -62,7 +65,7 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
parent::getSubscribedServices(),
|
||||
[
|
||||
'chill_main.paginator_factory' => PaginatorFactory::class,
|
||||
|
||||
ManagerRegistry::class => ManagerRegistry::class,
|
||||
'translator' => TranslatorInterface::class,
|
||||
AuthorizationHelper::class => AuthorizationHelper::class,
|
||||
EventDispatcherInterface::class => EventDispatcherInterface::class,
|
||||
@@ -97,7 +100,7 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
*/
|
||||
protected function buildQueryEntities(string $action, Request $request)
|
||||
{
|
||||
$qb = $this->managerRegistry->getManager()
|
||||
$qb = $this->getManagerRegistry()->getManager()
|
||||
->createQueryBuilder()
|
||||
->select('e')
|
||||
->from($this->getEntityClass(), 'e');
|
||||
@@ -118,7 +121,7 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
*
|
||||
* @param mixed|null $entity
|
||||
*
|
||||
* @throws \Symfony\Component\Security\Core\Exception\AccessDeniedHttpException
|
||||
* @throws AccessDeniedHttpException
|
||||
*/
|
||||
protected function checkACL(string $action, Request $request, string $_format, $entity = null)
|
||||
{
|
||||
@@ -147,9 +150,7 @@ 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)
|
||||
{
|
||||
@@ -171,7 +172,7 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
*/
|
||||
protected function getEntity(mixed $action, string $id, Request $request): object
|
||||
{
|
||||
$e = $this->managerRegistry
|
||||
$e = $this->getManagerRegistry()
|
||||
->getRepository($this->getEntityClass())
|
||||
->find($id);
|
||||
|
||||
@@ -182,7 +183,7 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
$expectedVersion = $request->query->getInt('entity_version');
|
||||
|
||||
try {
|
||||
$manager = $this->getDoctrine()->getManagerForClass($this->getEntityClass());
|
||||
$manager = $this->managerRegistry->getManagerForClass($this->getEntityClass());
|
||||
|
||||
if ($manager instanceof EntityManagerInterface) {
|
||||
$manager->lock($e, LockMode::OPTIMISTIC, $expectedVersion);
|
||||
@@ -212,6 +213,11 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
return $this->container->get('chill_main.paginator_factory');
|
||||
}
|
||||
|
||||
protected function getManagerRegistry(): ManagerRegistry
|
||||
{
|
||||
return $this->container->get(ManagerRegistry::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the result of the query.
|
||||
*/
|
||||
|
@@ -23,8 +23,6 @@ use Symfony\Component\Validator\ConstraintViolationListInterface;
|
||||
|
||||
class ApiController extends AbstractCRUDController
|
||||
{
|
||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||
|
||||
/**
|
||||
* Base method for handling api action.
|
||||
*
|
||||
@@ -82,8 +80,8 @@ class ApiController extends AbstractCRUDController
|
||||
return $response;
|
||||
}
|
||||
|
||||
$this->managerRegistry->getManager()->remove($entity);
|
||||
$this->managerRegistry->getManager()->flush();
|
||||
$this->getManagerRegistry()->getManager()->remove($entity);
|
||||
$this->getManagerRegistry()->getManager()->flush();
|
||||
|
||||
$response = $this->onAfterFlush($action, $request, $_format, $entity, $errors);
|
||||
|
||||
@@ -155,7 +153,7 @@ class ApiController extends AbstractCRUDController
|
||||
return $response;
|
||||
}
|
||||
|
||||
$this->managerRegistry->getManagerForClass($this->getEntityClass())->flush();
|
||||
$this->getManagerRegistry()->getManagerForClass($this->getEntityClass())->flush();
|
||||
|
||||
$response = $this->onAfterFlush($action, $request, $_format, $entity, $errors);
|
||||
|
||||
@@ -271,10 +269,10 @@ class ApiController extends AbstractCRUDController
|
||||
}
|
||||
|
||||
if ($forcePersist && Request::METHOD_POST === $request->getMethod()) {
|
||||
$this->managerRegistry->getManager()->persist($postedData);
|
||||
$this->getManagerRegistry()->getManager()->persist($postedData);
|
||||
}
|
||||
|
||||
$this->managerRegistry->getManager()->flush();
|
||||
$this->getManagerRegistry()->getManager()->flush();
|
||||
|
||||
$response = $this->onAfterFlush($action, $request, $_format, $entity, $errors, [$postedData]);
|
||||
|
||||
@@ -375,7 +373,7 @@ class ApiController extends AbstractCRUDController
|
||||
try {
|
||||
$entity = $this->deserialize($action, $request, $_format, $entity);
|
||||
} catch (NotEncodableValueException $e) {
|
||||
throw new BadRequestHttpException('invalid json', 400, $e);
|
||||
throw new BadRequestHttpException('invalid json', $e, 400);
|
||||
}
|
||||
|
||||
$errors = $this->validate($action, $request, $_format, $entity);
|
||||
@@ -405,8 +403,8 @@ class ApiController extends AbstractCRUDController
|
||||
return $response;
|
||||
}
|
||||
|
||||
$this->managerRegistry->getManager()->persist($entity);
|
||||
$this->managerRegistry->getManager()->flush();
|
||||
$this->getManagerRegistry()->getManager()->persist($entity);
|
||||
$this->getManagerRegistry()->getManager()->flush();
|
||||
|
||||
$response = $this->onAfterFlush($action, $request, $_format, $entity, $errors);
|
||||
|
||||
|
@@ -248,13 +248,9 @@ 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
|
||||
@@ -873,9 +869,7 @@ 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
|
||||
{
|
||||
@@ -887,58 +881,36 @@ 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,6 +16,4 @@ use Symfony\Component\Form\AbstractType;
|
||||
/**
|
||||
* Class CRUDDeleteEntityForm.
|
||||
*/
|
||||
class CRUDDeleteEntityForm extends AbstractType
|
||||
{
|
||||
}
|
||||
class CRUDDeleteEntityForm extends AbstractType {}
|
||||
|
@@ -194,14 +194,8 @@ 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 {}
|
||||
|
@@ -26,9 +26,7 @@ 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,9 +23,7 @@ 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"})
|
||||
|
@@ -24,9 +24,7 @@ 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,6 +13,4 @@ namespace Chill\MainBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
|
||||
class LocationTypeController extends CRUDController
|
||||
{
|
||||
}
|
||||
class LocationTypeController extends CRUDController {}
|
||||
|
@@ -46,7 +46,5 @@ class LoginController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
public function LoginCheckAction(Request $request)
|
||||
{
|
||||
}
|
||||
public function LoginCheckAction(Request $request) {}
|
||||
}
|
||||
|
@@ -31,9 +31,7 @@ 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"})
|
||||
|
@@ -40,9 +40,7 @@ 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 ChillSecurity $security, private readonly NotificationRepository $notificationRepository, private readonly NotificationHandlerManager $notificationHandlerManager, private readonly PaginatorFactory $paginatorFactory, private readonly TranslatorInterface $translator, private readonly UserRepository $userRepository, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
||||
{
|
||||
}
|
||||
public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $chillLogger, private readonly LoggerInterface $logger, private readonly ChillSecurity $security, private readonly NotificationRepository $notificationRepository, private readonly NotificationHandlerManager $notificationHandlerManager, private readonly PaginatorFactory $paginatorFactory, private readonly TranslatorInterface $translator, private readonly UserRepository $userRepository, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||
|
||||
/**
|
||||
* @Route("/create", name="chill_main_notification_create")
|
||||
|
@@ -21,9 +21,7 @@ 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,8 +47,7 @@ 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"})
|
||||
@@ -317,8 +316,8 @@ final class PermissionsGroupController extends AbstractController
|
||||
}
|
||||
|
||||
return strcmp(
|
||||
$translatableStringHelper->localize($a->getScope()->getName()),
|
||||
$translatableStringHelper->localize($b->getScope()->getName())
|
||||
(string) $translatableStringHelper->localize($a->getScope()->getName()),
|
||||
(string) $translatableStringHelper->localize($b->getScope()->getName())
|
||||
);
|
||||
}
|
||||
);
|
||||
|
@@ -26,9 +26,7 @@ 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,9 +34,7 @@ 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")
|
||||
|
@@ -32,9 +32,7 @@ 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")
|
||||
|
@@ -20,9 +20,7 @@ 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",
|
||||
|
@@ -48,9 +48,7 @@ class UserController extends CRUDController
|
||||
private readonly TranslatorInterface $translator,
|
||||
private readonly ChillSecurity $security,
|
||||
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry
|
||||
)
|
||||
{
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/admin/main/user/{uid}/add_link_groupcenter",
|
||||
|
@@ -27,8 +27,7 @@ final readonly class UserExportController
|
||||
private UserRepositoryInterface $userRepository,
|
||||
private Security $security,
|
||||
private TranslatorInterface $translator,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @throws \League\Csv\CannotInsertRecord
|
||||
|
@@ -21,8 +21,7 @@ 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")
|
||||
|
@@ -28,8 +28,7 @@ final class UserProfileController extends AbstractController
|
||||
private readonly TranslatorInterface $translator,
|
||||
private readonly ChillSecurity $security,
|
||||
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* User profile that allows editing of phonenumber and visualization of certain data.
|
||||
|
@@ -29,9 +29,7 @@ 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,9 +38,7 @@ 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 ChillSecurity $security, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
||||
{
|
||||
}
|
||||
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 ChillSecurity $security, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/main/workflow/create", name="chill_main_workflow_create")
|
||||
|
@@ -55,8 +55,7 @@ final readonly class CronManager implements CronManagerInterface
|
||||
private EntityManagerInterface $entityManager,
|
||||
private iterable $jobs,
|
||||
private LoggerInterface $logger
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function run(?string $forceJob = null): void
|
||||
{
|
||||
|
@@ -344,11 +344,11 @@ class LoadPostalCodes extends AbstractFixture implements OrderedFixtureInterface
|
||||
->findOneBy(['countryCode' => $countryCode]);
|
||||
|
||||
foreach ($lines as $line) {
|
||||
$code = str_getcsv($line);
|
||||
$code = str_getcsv((string) $line);
|
||||
$c = new PostalCode();
|
||||
$c->setCountry($country)
|
||||
->setCode($code[0])
|
||||
->setName(\ucwords(\strtolower($code[1])));
|
||||
->setName(\ucwords(\strtolower((string) $code[1])));
|
||||
|
||||
if (null !== ($code[3] ?? null)) {
|
||||
$c->setRefPostalCodeId($code[3]);
|
||||
|
@@ -21,9 +21,7 @@ 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,9 +15,7 @@ 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,6 +53,5 @@ class SimpleGeographicalUnitDTO
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
public int $layerId
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
}
|
||||
|
@@ -198,9 +198,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function eraseCredentials()
|
||||
{
|
||||
}
|
||||
public function eraseCredentials() {}
|
||||
|
||||
public function getAbsenceStart(): ?\DateTimeImmutable
|
||||
{
|
||||
|
@@ -26,8 +26,7 @@ final readonly class ExportFormHelper
|
||||
private AuthorizationHelperForCurrentUserInterface $authorizationHelper,
|
||||
private ExportManager $exportManager,
|
||||
private FormFactoryInterface $formFactory,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function getDefaultData(string $step, DirectExportInterface|ExportInterface $export, array $options = []): array
|
||||
{
|
||||
|
@@ -15,9 +15,7 @@ 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,9 +79,7 @@ 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,9 +21,7 @@ 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,9 +16,7 @@ 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,6 +20,4 @@ namespace Chill\MainBundle\Export;
|
||||
*
|
||||
* When used, the `ExportManager` will not handle aggregator for this class.
|
||||
*/
|
||||
interface ListInterface extends ExportInterface
|
||||
{
|
||||
}
|
||||
interface ListInterface extends ExportInterface {}
|
||||
|
@@ -17,8 +17,7 @@ final readonly class SortExportElement
|
||||
{
|
||||
public function __construct(
|
||||
private TranslatorInterface $translator,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @param array<int|string, FilterInterface> $elements
|
||||
|
@@ -19,9 +19,7 @@ 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, iterable $forms)
|
||||
{
|
||||
|
@@ -16,9 +16,7 @@ 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, iterable $forms)
|
||||
{
|
||||
|
@@ -17,9 +17,7 @@ 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,9 +24,7 @@ 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)
|
||||
{
|
||||
|
@@ -17,9 +17,7 @@ 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,9 +20,7 @@ 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,9 +22,7 @@ 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,9 +17,7 @@ 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,9 +17,7 @@ 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,9 +18,7 @@ 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,9 +18,7 @@ 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,9 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class AggregatorType extends AbstractType
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
public function __construct() {}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -29,9 +29,7 @@ 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,9 +22,7 @@ class FilterType extends AbstractType
|
||||
{
|
||||
final public const ENABLED_FIELD = 'enabled';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
public function __construct() {}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -33,8 +33,7 @@ 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,9 +41,7 @@ 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,9 +34,7 @@ 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,9 +21,7 @@ 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,9 +19,7 @@ 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,9 +21,7 @@ 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,9 +27,7 @@ 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,9 +20,7 @@ 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,9 +21,7 @@ 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)
|
||||
{
|
||||
|
@@ -43,9 +43,7 @@ class ScopePickerType extends AbstractType
|
||||
private readonly AuthorizationHelperInterface $authorizationHelper,
|
||||
private readonly Security $security,
|
||||
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
||||
)
|
||||
{
|
||||
}
|
||||
) {}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -26,9 +26,7 @@ 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)
|
||||
{
|
||||
|
@@ -26,9 +26,7 @@ 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)
|
||||
{
|
||||
|
@@ -36,9 +36,7 @@ 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,9 +34,7 @@ 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)
|
||||
{
|
||||
|
@@ -24,9 +24,7 @@ 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,9 +24,7 @@ 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,9 +18,7 @@ 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,6 +11,4 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Notification\Exception;
|
||||
|
||||
class NotificationHandlerNotFound extends \RuntimeException
|
||||
{
|
||||
}
|
||||
class NotificationHandlerNotFound extends \RuntimeException {}
|
||||
|
@@ -34,9 +34,7 @@ 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,9 +17,7 @@ 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,9 +23,7 @@ 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,9 +21,7 @@ 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,9 +18,7 @@ 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,8 +57,7 @@ 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
|
||||
{
|
||||
|
@@ -39,8 +39,7 @@ final readonly class PaginatorFactory implements PaginatorFactoryInterface
|
||||
* the request or inside the paginator.
|
||||
*/
|
||||
private int $itemPerPage = 20
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* create a paginator instance.
|
||||
|
@@ -16,9 +16,7 @@ use Twig\TwigFilter;
|
||||
|
||||
class Templating extends AbstractExtension
|
||||
{
|
||||
public function __construct(protected PhonenumberHelper $phonenumberHelper)
|
||||
{
|
||||
}
|
||||
public function __construct(protected PhonenumberHelper $phonenumberHelper) {}
|
||||
|
||||
public function formatPhonenumber($phonenumber)
|
||||
{
|
||||
|
@@ -16,6 +16,4 @@ use Redis;
|
||||
/**
|
||||
* Redis client configured by chill main.
|
||||
*/
|
||||
class ChillRedis extends \Redis
|
||||
{
|
||||
}
|
||||
class ChillRedis extends \Redis {}
|
||||
|
@@ -19,9 +19,7 @@ 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,9 +26,7 @@ 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,9 +22,7 @@ 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,9 +29,7 @@ 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,9 +35,7 @@ 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,9 +17,7 @@ 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,8 +19,7 @@ class Result
|
||||
* mixed an arbitrary result.
|
||||
*/
|
||||
private $result
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function getRelevance(): float
|
||||
{
|
||||
|
@@ -11,6 +11,4 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Search;
|
||||
|
||||
class ParsingException extends \Exception
|
||||
{
|
||||
}
|
||||
class ParsingException extends \Exception {}
|
||||
|
@@ -20,9 +20,7 @@ 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,9 +17,7 @@ class SearchApiResult
|
||||
{
|
||||
private mixed $result;
|
||||
|
||||
public function __construct(private readonly float $relevance)
|
||||
{
|
||||
}
|
||||
public function __construct(private readonly float $relevance) {}
|
||||
|
||||
/**
|
||||
* @Serializer\Groups({"read"})
|
||||
|
@@ -13,9 +13,7 @@ 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,6 +18,4 @@ 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 {}
|
||||
|
@@ -34,8 +34,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface
|
||||
private readonly ScopeResolverDispatcher $scopeResolverDispatcher,
|
||||
private readonly UserACLAwareRepositoryInterface $userACLAwareRepository,
|
||||
private readonly ParentRoleHelper $parentRoleHelper
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Filter an array of centers, return only center which are reachable.
|
||||
|
@@ -17,9 +17,7 @@ use Symfony\Component\Security\Core\Security;
|
||||
|
||||
class AuthorizationHelperForCurrentUser implements AuthorizationHelperForCurrentUserInterface
|
||||
{
|
||||
public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security)
|
||||
{
|
||||
}
|
||||
public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security) {}
|
||||
|
||||
public function getReachableCenters(string $role, ?Scope $scope = null): array
|
||||
{
|
||||
|
@@ -14,6 +14,4 @@ namespace Chill\MainBundle\Security\Authorization;
|
||||
/**
|
||||
* Provides methods for compiling voter and build admin role fields.
|
||||
*/
|
||||
interface ChillVoterInterface
|
||||
{
|
||||
}
|
||||
interface ChillVoterInterface {}
|
||||
|
@@ -18,8 +18,7 @@ final readonly class DefaultVoterHelper implements VoterHelperInterface
|
||||
public function __construct(
|
||||
private AuthorizationHelper $authorizationHelper,
|
||||
private array $configuration
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function supports($attribute, $subject): bool
|
||||
{
|
||||
|
@@ -13,9 +13,7 @@ namespace Chill\MainBundle\Security\Authorization;
|
||||
|
||||
class DefaultVoterHelperFactory implements VoterHelperFactoryInterface
|
||||
{
|
||||
public function __construct(protected AuthorizationHelper $authorizationHelper)
|
||||
{
|
||||
}
|
||||
public function __construct(protected AuthorizationHelper $authorizationHelper) {}
|
||||
|
||||
public function generate($context): VoterGeneratorInterface
|
||||
{
|
||||
|
@@ -15,9 +15,7 @@ final class DefaultVoterHelperGenerator implements VoterGeneratorInterface
|
||||
{
|
||||
private array $configuration = [];
|
||||
|
||||
public function __construct(private readonly AuthorizationHelper $authorizationHelper)
|
||||
{
|
||||
}
|
||||
public function __construct(private readonly AuthorizationHelper $authorizationHelper) {}
|
||||
|
||||
public function addCheckFor(?string $class, array $attributes): self
|
||||
{
|
||||
|
@@ -27,9 +27,7 @@ class EntityWorkflowVoter extends Voter
|
||||
|
||||
final public const SHOW_ENTITY_LINK = 'CHILL_MAIN_WORKFLOW_LINK_SHOW';
|
||||
|
||||
public function __construct(private readonly EntityWorkflowManager $manager, private readonly Security $security)
|
||||
{
|
||||
}
|
||||
public function __construct(private readonly EntityWorkflowManager $manager, private readonly Security $security) {}
|
||||
|
||||
protected function supports($attribute, $subject)
|
||||
{
|
||||
|
@@ -20,9 +20,7 @@ class WorkflowEntityDeletionVoter extends Voter
|
||||
/**
|
||||
* @param \Chill\MainBundle\Workflow\EntityWorkflowHandlerInterface[] $handlers
|
||||
*/
|
||||
public function __construct(private $handlers, private readonly EntityWorkflowRepository $entityWorkflowRepository)
|
||||
{
|
||||
}
|
||||
public function __construct(private $handlers, private readonly EntityWorkflowRepository $entityWorkflowRepository) {}
|
||||
|
||||
protected function supports($attribute, $subject)
|
||||
{
|
||||
|
@@ -30,8 +30,7 @@ class PasswordRecoverEvent extends \Symfony\Contracts\EventDispatcher\Event
|
||||
private readonly ?User $user = null,
|
||||
private $ip = null,
|
||||
private readonly bool $safelyGenerated = false,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function getIp()
|
||||
{
|
||||
|
@@ -20,9 +20,7 @@ class RecoverPasswordHelper
|
||||
{
|
||||
final public const RECOVER_PASSWORD_ROUTE = 'password_recover';
|
||||
|
||||
public function __construct(private readonly TokenManager $tokenManager, private readonly UrlGeneratorInterface $urlGenerator, private readonly MailerInterface $mailer)
|
||||
{
|
||||
}
|
||||
public function __construct(private readonly TokenManager $tokenManager, private readonly UrlGeneratorInterface $urlGenerator, private readonly MailerInterface $mailer) {}
|
||||
|
||||
/**
|
||||
* @param bool $absolute
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user