mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Rector changes and immplementations of required methods
This commit is contained in:
parent
d9a47fdee9
commit
9fcc1634f5
@ -28,7 +28,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
|
|||||||
}
|
}
|
||||||
|
|
||||||
// here, we alter the query created by Export
|
// here, we alter the query created by Export
|
||||||
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data)
|
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
$where = $qb->getDQLPart('where');
|
||||||
// we create the clause here
|
// we create the clause here
|
||||||
@ -58,7 +58,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
|
|||||||
}
|
}
|
||||||
|
|
||||||
// we build a form to collect some parameters from the users
|
// we build a form to collect some parameters from the users
|
||||||
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
|
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('date_from', DateType::class, [
|
$builder->add('date_from', DateType::class, [
|
||||||
'label' => 'Born after this date',
|
'label' => 'Born after this date',
|
||||||
@ -99,7 +99,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
|
|||||||
// is executed here. This function is added by the interface
|
// is executed here. This function is added by the interface
|
||||||
// `ExportElementValidatedInterface`, and can be ignore if there is
|
// `ExportElementValidatedInterface`, and can be ignore if there is
|
||||||
// no need for a validation
|
// no need for a validation
|
||||||
public function validateForm($data, ExecutionContextInterface $context)
|
public function validateForm($data, ExecutionContextInterface $context): void
|
||||||
{
|
{
|
||||||
$date_from = $data['date_from'];
|
$date_from = $data['date_from'];
|
||||||
$date_to = $data['date_to'];
|
$date_to = $data['date_to'];
|
||||||
|
@ -32,7 +32,7 @@ class CountPerson implements ExportInterface
|
|||||||
$this->entityManager = $em;
|
$this->entityManager = $em;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// this export does not add any form
|
// this export does not add any form
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ class example extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractControl
|
|||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
public function yourAction()
|
public function yourAction(): \Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
// first, get the number of total item are available
|
// first, get the number of total item are available
|
||||||
|
@ -28,7 +28,7 @@ class ConsultationController extends \Symfony\Bundle\FrameworkBundle\Controller\
|
|||||||
*
|
*
|
||||||
* @return \Symfony\Component\HttpFoundation\Response
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
*/
|
*/
|
||||||
public function listAction($id)
|
public function listAction($id): \Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
/** @var \Chill\PersonBundle\Entity\Person $person */
|
/** @var \Chill\PersonBundle\Entity\Person $person */
|
||||||
$person = $this->get('chill.person.repository.person')
|
$person = $this->get('chill.person.repository.person')
|
||||||
|
@ -31,7 +31,7 @@ class ChillMainConfiguration implements ConfigurationInterface
|
|||||||
$this->setWidgetFactories($widgetFactories);
|
$this->setWidgetFactories($widgetFactories);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder(): \Symfony\Component\Config\Definition\Builder\TreeBuilder
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder('chill_main');
|
$treeBuilder = new TreeBuilder('chill_main');
|
||||||
$rootNode = $treeBuilder->getRootNode();
|
$rootNode = $treeBuilder->getRootNode();
|
||||||
|
@ -27,12 +27,12 @@ class ChillMainExtension extends Extension implements Widget\HasWidgetFactoriesE
|
|||||||
*/
|
*/
|
||||||
protected $widgetFactories = [];
|
protected $widgetFactories = [];
|
||||||
|
|
||||||
public function addWidgetFactory(WidgetFactoryInterface $factory)
|
public function addWidgetFactory(WidgetFactoryInterface $factory): void
|
||||||
{
|
{
|
||||||
$this->widgetFactories[] = $factory;
|
$this->widgetFactories[] = $factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getConfiguration(array $config, ContainerBuilder $container)
|
public function getConfiguration(array $config, ContainerBuilder $container): ?\Symfony\Component\Config\Definition\ConfigurationInterface
|
||||||
{
|
{
|
||||||
return new Configuration($this->widgetFactories, $container);
|
return new Configuration($this->widgetFactories, $container);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ class ChillMainExtension extends Extension implements Widget\HasWidgetFactoriesE
|
|||||||
return $this->widgetFactories;
|
return $this->widgetFactories;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function load(array $configs, ContainerBuilder $container)
|
public function load(array $configs, ContainerBuilder $container): void
|
||||||
{
|
{
|
||||||
// configuration for main bundle
|
// configuration for main bundle
|
||||||
$configuration = $this->getConfiguration($configs, $container);
|
$configuration = $this->getConfiguration($configs, $container);
|
||||||
|
@ -25,7 +25,7 @@ class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory
|
|||||||
* see http://symfony.com/doc/current/components/config/definition.html
|
* see http://symfony.com/doc/current/components/config/definition.html
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function configureOptions($place, NodeBuilder $node)
|
public function configureOptions($place, NodeBuilder $node): void
|
||||||
{
|
{
|
||||||
$node->booleanNode('only_active')
|
$node->booleanNode('only_active')
|
||||||
->defaultTrue()
|
->defaultTrue()
|
||||||
|
@ -124,7 +124,7 @@ class ChillPersonAddAPersonWidget implements WidgetInterface
|
|||||||
/**
|
/**
|
||||||
* @return UserInterface
|
* @return UserInterface
|
||||||
*/
|
*/
|
||||||
private function getUser()
|
private function getUser(): void
|
||||||
{
|
{
|
||||||
// return a user
|
// return a user
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
|||||||
*/
|
*/
|
||||||
class ChillPersonExtension extends Extension implements PrependExtensionInterface
|
class ChillPersonExtension extends Extension implements PrependExtensionInterface
|
||||||
{
|
{
|
||||||
public function load(array $configs, ContainerBuilder $container)
|
public function load(array $configs, ContainerBuilder $container): void
|
||||||
{
|
{
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
@ -32,7 +32,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
*
|
*
|
||||||
* @param \Chill\PersonBundle\DependencyInjection\containerBuilder $container
|
* @param \Chill\PersonBundle\DependencyInjection\containerBuilder $container
|
||||||
*/
|
*/
|
||||||
public function prepend(ContainerBuilder $container)
|
public function prepend(ContainerBuilder $container): void
|
||||||
{
|
{
|
||||||
$container->prependExtensionConfig('chill_main', [
|
$container->prependExtensionConfig('chill_main', [
|
||||||
'widgets' => [
|
'widgets' => [
|
||||||
|
13
rector.php
13
rector.php
@ -36,6 +36,12 @@ return static function (RectorConfig $rectorConfig): void {
|
|||||||
$rectorConfig->rule(Rector\TypeDeclaration\Rector\Class_\MergeDateTimePropertyTypeDeclarationRector::class);
|
$rectorConfig->rule(Rector\TypeDeclaration\Rector\Class_\MergeDateTimePropertyTypeDeclarationRector::class);
|
||||||
$rectorConfig->rule(Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationBasedOnParentClassMethodRector::class);
|
$rectorConfig->rule(Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationBasedOnParentClassMethodRector::class);
|
||||||
|
|
||||||
|
// Add return types to controller methods
|
||||||
|
$rectorConfig->rule(Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector::class);
|
||||||
|
$rectorConfig->rule(Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector::class);
|
||||||
|
$rectorConfig->rule(Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector::class);
|
||||||
|
$rectorConfig->rule(Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedPropertyRector::class);
|
||||||
|
|
||||||
// part of the symfony 54 rules
|
// part of the symfony 54 rules
|
||||||
$rectorConfig->rule(\Rector\Symfony\Symfony53\Rector\StaticPropertyFetch\KernelTestCaseContainerPropertyDeprecationRector::class);
|
$rectorConfig->rule(\Rector\Symfony\Symfony53\Rector\StaticPropertyFetch\KernelTestCaseContainerPropertyDeprecationRector::class);
|
||||||
$rectorConfig->rule(\Rector\Symfony\Symfony60\Rector\MethodCall\GetHelperControllerToServiceRector::class);
|
$rectorConfig->rule(\Rector\Symfony\Symfony60\Rector\MethodCall\GetHelperControllerToServiceRector::class);
|
||||||
@ -49,6 +55,13 @@ return static function (RectorConfig $rectorConfig): void {
|
|||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_42,
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_42,
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_43,
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_43,
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_44,
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_44,
|
||||||
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_50,
|
||||||
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_51,
|
||||||
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_52,
|
||||||
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_53,
|
||||||
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_54,
|
||||||
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_60,
|
||||||
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_61,
|
||||||
\Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
|
\Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
|
||||||
\Rector\PHPUnit\Set\PHPUnitSetList::PHPUNIT_90,
|
\Rector\PHPUnit\Set\PHPUnitSetList::PHPUNIT_90,
|
||||||
]);
|
]);
|
||||||
|
@ -75,7 +75,7 @@ final class ActivityController extends AbstractController
|
|||||||
* Deletes a Activity entity.
|
* Deletes a Activity entity.
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/{id}/delete', name: 'chill_activity_activity_delete', methods: ['GET', 'POST', 'DELETE'])]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/{id}/delete', name: 'chill_activity_activity_delete', methods: ['GET', 'POST', 'DELETE'])]
|
||||||
public function deleteAction(Request $request, mixed $id)
|
public function deleteAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$view = null;
|
$view = null;
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ final class ActivityController extends AbstractController
|
|||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->logger->notice('An activity has been removed', [
|
$this->logger->notice('An activity has been removed', [
|
||||||
'by_user' => $this->getUser()->getUsername(),
|
'by_user' => $this->getUser()->getUserIdentifier(),
|
||||||
'activity_id' => $activity->getId(),
|
'activity_id' => $activity->getId(),
|
||||||
'person_id' => $activity->getPerson() ? $activity->getPerson()->getId() : null,
|
'person_id' => $activity->getPerson() ? $activity->getPerson()->getId() : null,
|
||||||
'comment' => $activity->getComment()->getComment(),
|
'comment' => $activity->getComment()->getComment(),
|
||||||
|
@ -28,7 +28,7 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
* Creates a new ActivityReasonCategory entity.
|
* Creates a new ActivityReasonCategory entity.
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/create', name: 'chill_activity_activityreasoncategory_create', methods: ['POST'])]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/create', name: 'chill_activity_activityreasoncategory_create', methods: ['POST'])]
|
||||||
public function createAction(Request $request)
|
public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$entity = new ActivityReasonCategory();
|
$entity = new ActivityReasonCategory();
|
||||||
$form = $this->createCreateForm($entity);
|
$form = $this->createCreateForm($entity);
|
||||||
@ -52,7 +52,7 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
* Displays a form to edit an existing ActivityReasonCategory entity.
|
* Displays a form to edit an existing ActivityReasonCategory entity.
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/edit', name: 'chill_activity_activityreasoncategory_edit')]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/edit', name: 'chill_activity_activityreasoncategory_edit')]
|
||||||
public function editAction(mixed $id)
|
public function editAction(mixed $id): \Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
* Lists all ActivityReasonCategory entities.
|
* Lists all ActivityReasonCategory entities.
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/', name: 'chill_activity_activityreasoncategory')]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/', name: 'chill_activity_activityreasoncategory')]
|
||||||
public function indexAction()
|
public function indexAction(): \Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
* Displays a form to create a new ActivityReasonCategory entity.
|
* Displays a form to create a new ActivityReasonCategory entity.
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/new', name: 'chill_activity_activityreasoncategory_new')]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/new', name: 'chill_activity_activityreasoncategory_new')]
|
||||||
public function newAction()
|
public function newAction(): \Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$entity = new ActivityReasonCategory();
|
$entity = new ActivityReasonCategory();
|
||||||
$form = $this->createCreateForm($entity);
|
$form = $this->createCreateForm($entity);
|
||||||
@ -104,7 +104,7 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
* Finds and displays a ActivityReasonCategory entity.
|
* Finds and displays a ActivityReasonCategory entity.
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/show', name: 'chill_activity_activityreasoncategory_show')]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/show', name: 'chill_activity_activityreasoncategory_show')]
|
||||||
public function showAction(mixed $id)
|
public function showAction(mixed $id): \Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
* Edits an existing ActivityReasonCategory entity.
|
* Edits an existing ActivityReasonCategory entity.
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/update', name: 'chill_activity_activityreasoncategory_update', methods: ['POST', 'PUT'])]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/update', name: 'chill_activity_activityreasoncategory_update', methods: ['POST', 'PUT'])]
|
||||||
public function updateAction(Request $request, mixed $id)
|
public function updateAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class ActivityReasonController extends AbstractController
|
|||||||
* Creates a new ActivityReason entity.
|
* Creates a new ActivityReason entity.
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/create', name: 'chill_activity_activityreason_create', methods: ['POST'])]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/create', name: 'chill_activity_activityreason_create', methods: ['POST'])]
|
||||||
public function createAction(Request $request)
|
public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$entity = new ActivityReason();
|
$entity = new ActivityReason();
|
||||||
$form = $this->createCreateForm($entity);
|
$form = $this->createCreateForm($entity);
|
||||||
@ -54,7 +54,7 @@ class ActivityReasonController extends AbstractController
|
|||||||
* Displays a form to edit an existing ActivityReason entity.
|
* Displays a form to edit an existing ActivityReason entity.
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/edit', name: 'chill_activity_activityreason_edit')]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/edit', name: 'chill_activity_activityreason_edit')]
|
||||||
public function editAction(mixed $id)
|
public function editAction(mixed $id): \Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ class ActivityReasonController extends AbstractController
|
|||||||
* Lists all ActivityReason entities.
|
* Lists all ActivityReason entities.
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/', name: 'chill_activity_activityreason')]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/', name: 'chill_activity_activityreason')]
|
||||||
public function indexAction()
|
public function indexAction(): \Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ class ActivityReasonController extends AbstractController
|
|||||||
* Displays a form to create a new ActivityReason entity.
|
* Displays a form to create a new ActivityReason entity.
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/new', name: 'chill_activity_activityreason_new')]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/new', name: 'chill_activity_activityreason_new')]
|
||||||
public function newAction()
|
public function newAction(): \Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$entity = new ActivityReason();
|
$entity = new ActivityReason();
|
||||||
$form = $this->createCreateForm($entity);
|
$form = $this->createCreateForm($entity);
|
||||||
@ -106,7 +106,7 @@ class ActivityReasonController extends AbstractController
|
|||||||
* Finds and displays a ActivityReason entity.
|
* Finds and displays a ActivityReason entity.
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/show', name: 'chill_activity_activityreason_show')]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/show', name: 'chill_activity_activityreason_show')]
|
||||||
public function showAction(mixed $id)
|
public function showAction(mixed $id): \Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ class ActivityReasonController extends AbstractController
|
|||||||
* Edits an existing ActivityReason entity.
|
* Edits an existing ActivityReason entity.
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/update', name: 'chill_activity_activityreason_update', methods: ['POST', 'PUT'])]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/update', name: 'chill_activity_activityreason_update', methods: ['POST', 'PUT'])]
|
||||||
public function updateAction(Request $request, mixed $id)
|
public function updateAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
|
@ -19,14 +19,14 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|||||||
class AdminController extends AbstractController
|
class AdminController extends AbstractController
|
||||||
{
|
{
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity', name: 'chill_activity_admin_index')]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity', name: 'chill_activity_admin_index')]
|
||||||
public function indexActivityAction()
|
public function indexActivityAction(): \Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
return $this->render('@ChillActivity/Admin/layout_activity.html.twig');
|
return $this->render('@ChillActivity/Admin/layout_activity.html.twig');
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity_redirect_to_main', name: 'chill_admin_aside_activity_redirect_to_admin_index', options: [null])]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity_redirect_to_main', name: 'chill_admin_aside_activity_redirect_to_admin_index', options: [null])]
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity_redirect_to_main', name: 'chill_admin_activity_redirect_to_admin_index')]
|
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity_redirect_to_main', name: 'chill_admin_activity_redirect_to_admin_index')]
|
||||||
public function redirectToAdminIndexAction()
|
public function redirectToAdminIndexAction(): \Symfony\Component\HttpFoundation\RedirectResponse
|
||||||
{
|
{
|
||||||
return $this->redirectToRoute('chill_main_admin_central');
|
return $this->redirectToRoute('chill_main_admin_central');
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
|||||||
*/
|
*/
|
||||||
class ChillActivityExtension extends Extension implements PrependExtensionInterface
|
class ChillActivityExtension extends Extension implements PrependExtensionInterface
|
||||||
{
|
{
|
||||||
public function load(array $configs, ContainerBuilder $container)
|
public function load(array $configs, ContainerBuilder $container): void
|
||||||
{
|
{
|
||||||
$configuration = new Configuration();
|
$configuration = new Configuration();
|
||||||
$config = $this->processConfiguration($configuration, $configs);
|
$config = $this->processConfiguration($configuration, $configs);
|
||||||
@ -44,14 +44,14 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
|
|||||||
$loader->load('services/doctrine.entitylistener.yaml');
|
$loader->load('services/doctrine.entitylistener.yaml');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function prepend(ContainerBuilder $container)
|
public function prepend(ContainerBuilder $container): void
|
||||||
{
|
{
|
||||||
$this->prependRoutes($container);
|
$this->prependRoutes($container);
|
||||||
$this->prependAuthorization($container);
|
$this->prependAuthorization($container);
|
||||||
$this->prependCruds($container);
|
$this->prependCruds($container);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function prependAuthorization(ContainerBuilder $container)
|
public function prependAuthorization(ContainerBuilder $container): void
|
||||||
{
|
{
|
||||||
$container->prependExtensionConfig('security', [
|
$container->prependExtensionConfig('security', [
|
||||||
'role_hierarchy' => [
|
'role_hierarchy' => [
|
||||||
@ -71,7 +71,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
|
|||||||
/** (non-PHPdoc).
|
/** (non-PHPdoc).
|
||||||
* @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend()
|
* @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend()
|
||||||
*/
|
*/
|
||||||
public function prependRoutes(ContainerBuilder $container)
|
public function prependRoutes(ContainerBuilder $container): void
|
||||||
{
|
{
|
||||||
// add routes for custom bundle
|
// add routes for custom bundle
|
||||||
$container->prependExtensionConfig('chill_main', [
|
$container->prependExtensionConfig('chill_main', [
|
||||||
|
@ -40,7 +40,7 @@ class ActivityReason
|
|||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function getActive()
|
public function getActive(): bool
|
||||||
{
|
{
|
||||||
return $this->active;
|
return $this->active;
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ class ActivityReason
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ class ActivityReasonCategory implements \Stringable
|
|||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function getActive()
|
public function getActive(): bool
|
||||||
{
|
{
|
||||||
return $this->active;
|
return $this->active;
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ class ActivityReasonCategory implements \Stringable
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ class ActivityType
|
|||||||
private int $userVisible = self::FIELD_REQUIRED;
|
private int $userVisible = self::FIELD_REQUIRED;
|
||||||
|
|
||||||
#[Assert\Callback]
|
#[Assert\Callback]
|
||||||
public function checkSocialActionsVisibility(ExecutionContextInterface $context, mixed $payload)
|
public function checkSocialActionsVisibility(ExecutionContextInterface $context, mixed $payload): void
|
||||||
{
|
{
|
||||||
if ($this->socialIssuesVisible !== $this->socialActionsVisible) {
|
if ($this->socialIssuesVisible !== $this->socialActionsVisible) {
|
||||||
// if social issues are invisible then social actions cannot be optional or required + if social issues are optional then social actions shouldn't be required
|
// if social issues are invisible then social actions cannot be optional or required + if social issues are optional then social actions shouldn't be required
|
||||||
|
@ -21,7 +21,7 @@ class ActivityEntityListener
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly EntityManagerInterface $em, private readonly AccompanyingPeriodWorkRepository $workRepository) {}
|
public function __construct(private readonly EntityManagerInterface $em, private readonly AccompanyingPeriodWorkRepository $workRepository) {}
|
||||||
|
|
||||||
public function persistActionToCourse(Activity $activity)
|
public function persistActionToCourse(Activity $activity): void
|
||||||
{
|
{
|
||||||
if ($activity->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
|
if ($activity->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
|
||||||
$period = $activity->getAccompanyingPeriod();
|
$period = $activity->getAccompanyingPeriod();
|
||||||
|
@ -33,7 +33,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
|
|||||||
private TranslatableStringHelperInterface $translatableStringHelper,
|
private TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('after_date', PickRollingDateType::class, [
|
->add('after_date', PickRollingDateType::class, [
|
||||||
@ -84,7 +84,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ class BySocialActionAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) {
|
if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) {
|
||||||
$qb->leftJoin('activity.socialActions', 'actsocialaction');
|
$qb->leftJoin('activity.socialActions', 'actsocialaction');
|
||||||
@ -42,7 +42,7 @@ class BySocialActionAggregator implements AggregatorInterface
|
|||||||
return Declarations::ACTIVITY_ACP;
|
return Declarations::ACTIVITY_ACP;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// no form
|
// no form
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ class BySocialIssueAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) {
|
if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) {
|
||||||
$qb->leftJoin('activity.socialIssues', 'actsocialissue');
|
$qb->leftJoin('activity.socialIssues', 'actsocialissue');
|
||||||
@ -42,7 +42,7 @@ class BySocialIssueAggregator implements AggregatorInterface
|
|||||||
return Declarations::ACTIVITY_ACP;
|
return Declarations::ACTIVITY_ACP;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// no form
|
// no form
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ final readonly class ActivityLocationAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
|
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
|
||||||
$qb->leftJoin('activity.location', 'actloc');
|
$qb->leftJoin('activity.location', 'actloc');
|
||||||
@ -39,7 +39,7 @@ final readonly class ActivityLocationAggregator implements AggregatorInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// no form required for this aggregator
|
// no form required for this aggregator
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ final readonly class ActivityPresenceAggregator implements AggregatorInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private ActivityPresenceRepositoryInterface $activityPresenceRepository, private TranslatableStringHelperInterface $translatableStringHelper) {}
|
public function __construct(private ActivityPresenceRepositoryInterface $activityPresenceRepository, private TranslatableStringHelperInterface $translatableStringHelper) {}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder): void {}
|
||||||
|
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
|
@ -36,7 +36,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
// add select element
|
// add select element
|
||||||
if ('reasons' === $data['level']) {
|
if ('reasons' === $data['level']) {
|
||||||
@ -72,7 +72,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add(
|
$builder->add(
|
||||||
'level',
|
'level',
|
||||||
@ -144,7 +144,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
return 'Aggregate by activity reason';
|
return 'Aggregate by activity reason';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateForm($data, ExecutionContextInterface $context)
|
public function validateForm($data, ExecutionContextInterface $context): void
|
||||||
{
|
{
|
||||||
if (null === $data['level']) {
|
if (null === $data['level']) {
|
||||||
$context
|
$context
|
||||||
|
@ -29,7 +29,7 @@ class ActivityTypeAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
if (!\in_array('acttype', $qb->getAllAliases(), true)) {
|
if (!\in_array('acttype', $qb->getAllAliases(), true)) {
|
||||||
$qb->leftJoin('activity.activityType', 'acttype');
|
$qb->leftJoin('activity.activityType', 'acttype');
|
||||||
@ -44,7 +44,7 @@ class ActivityTypeAggregator implements AggregatorInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// no form required for this aggregator
|
// no form required for this aggregator
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ class ActivityUserAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
// add select element
|
// add select element
|
||||||
$qb->addSelect(sprintf('IDENTITY(activity.user) AS %s', self::KEY));
|
$qb->addSelect(sprintf('IDENTITY(activity.user) AS %s', self::KEY));
|
||||||
@ -43,7 +43,7 @@ class ActivityUserAggregator implements AggregatorInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// nothing to add
|
// nothing to add
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ class ActivityUsersAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
if (!\in_array('actusers', $qb->getAllAliases(), true)) {
|
if (!\in_array('actusers', $qb->getAllAliases(), true)) {
|
||||||
$qb->leftJoin('activity.users', 'actusers');
|
$qb->leftJoin('activity.users', 'actusers');
|
||||||
@ -43,7 +43,7 @@ class ActivityUsersAggregator implements AggregatorInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// nothing to add on the form
|
// nothing to add on the form
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class ActivityUsersJobAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class ActivityUsersScopeAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ class ByCreatorAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$qb->addSelect('IDENTITY(activity.createdBy) AS creator_aggregator');
|
$qb->addSelect('IDENTITY(activity.createdBy) AS creator_aggregator');
|
||||||
$qb->addGroupBy('creator_aggregator');
|
$qb->addGroupBy('creator_aggregator');
|
||||||
@ -38,7 +38,7 @@ class ByCreatorAggregator implements AggregatorInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// no form
|
// no form
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ class ByThirdpartyAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
if (!\in_array('acttparty', $qb->getAllAliases(), true)) {
|
if (!\in_array('acttparty', $qb->getAllAliases(), true)) {
|
||||||
$qb->leftJoin('activity.thirdParties', 'acttparty');
|
$qb->leftJoin('activity.thirdParties', 'acttparty');
|
||||||
@ -42,7 +42,7 @@ class ByThirdpartyAggregator implements AggregatorInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// no form
|
// no form
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class CreatorJobAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class CreatorScopeAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ class DateAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$order = null;
|
$order = null;
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ class DateAggregator implements AggregatorInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('frequency', ChoiceType::class, [
|
$builder->add('frequency', ChoiceType::class, [
|
||||||
'choices' => self::CHOICES,
|
'choices' => self::CHOICES,
|
||||||
|
@ -27,7 +27,7 @@ class LocationTypeAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
|
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
|
||||||
$qb->leftJoin('activity.location', 'actloc');
|
$qb->leftJoin('activity.location', 'actloc');
|
||||||
@ -42,7 +42,7 @@ class LocationTypeAggregator implements AggregatorInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// no form
|
// no form
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ final readonly class HouseholdAggregator implements AggregatorInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private HouseholdRepository $householdRepository) {}
|
public function __construct(private HouseholdRepository $householdRepository) {}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// nothing to add here
|
// nothing to add here
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ final readonly class HouseholdAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$qb->join(
|
$qb->join(
|
||||||
HouseholdMember::class,
|
HouseholdMember::class,
|
||||||
|
@ -21,7 +21,7 @@ final readonly class PersonAggregator implements AggregatorInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private LabelPersonHelper $labelPersonHelper) {}
|
public function __construct(private LabelPersonHelper $labelPersonHelper) {}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// nothing to add here
|
// nothing to add here
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ final readonly class PersonAggregator implements AggregatorInterface
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLabels($key, array $values, mixed $data)
|
public function getLabels($key, array $values, mixed $data): callable
|
||||||
{
|
{
|
||||||
return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.person.by_person.person');
|
return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.person.by_person.person');
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ final readonly class PersonAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$qb
|
$qb
|
||||||
->addSelect('IDENTITY(activity.person) AS activity_by_person_agg')
|
->addSelect('IDENTITY(activity.person) AS activity_by_person_agg')
|
||||||
|
@ -27,7 +27,7 @@ final readonly class PersonsAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function __construct(private LabelPersonHelper $labelPersonHelper) {}
|
public function __construct(private LabelPersonHelper $labelPersonHelper) {}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// nothing to add here
|
// nothing to add here
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ final readonly class PersonsAggregator implements AggregatorInterface
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLabels($key, array $values, mixed $data)
|
public function getLabels($key, array $values, mixed $data): callable
|
||||||
{
|
{
|
||||||
if ($key !== self::PREFIX.'_pid') {
|
if ($key !== self::PREFIX.'_pid') {
|
||||||
throw new \UnexpectedValueException('this key should not be handled: '.$key);
|
throw new \UnexpectedValueException('this key should not be handled: '.$key);
|
||||||
@ -61,7 +61,7 @@ final readonly class PersonsAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// TODO: Implement buildForm() method.
|
// TODO: Implement buildForm() method.
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder): void {}
|
||||||
|
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
|
|||||||
private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper,
|
private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$this->helper->buildForm($builder);
|
$this->helper->buildForm($builder);
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
array_merge(
|
array_merge(
|
||||||
@ -95,7 +95,7 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
|
|||||||
return ListActivityHelper::MSG_KEY.'List activity linked to a course';
|
return ListActivityHelper::MSG_KEY.'List activity linked to a course';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getType()
|
public function getType(): string
|
||||||
{
|
{
|
||||||
return $this->helper->getType();
|
return $this->helper->getType();
|
||||||
}
|
}
|
||||||
@ -140,7 +140,7 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
|
|||||||
return ActivityStatsVoter::LISTS;
|
return ActivityStatsVoter::LISTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function supportsModifiers()
|
public function supportsModifiers(): array
|
||||||
{
|
{
|
||||||
return array_merge(
|
return array_merge(
|
||||||
$this->helper->supportsModifiers(),
|
$this->helper->supportsModifiers(),
|
||||||
|
@ -40,7 +40,7 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// TODO: Implement buildForm() method.
|
// TODO: Implement buildForm() method.
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// TODO: Implement buildForm() method.
|
// TODO: Implement buildForm() method.
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder): void {}
|
||||||
|
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
|
@ -59,7 +59,7 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('fields', ChoiceType::class, [
|
$builder->add('fields', ChoiceType::class, [
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
@ -38,7 +38,7 @@ final readonly class ActivityTypeFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$exists = self::BASE_EXISTS;
|
$exists = self::BASE_EXISTS;
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ final readonly class ActivityTypeFilter implements FilterInterface
|
|||||||
return Declarations::ACP_TYPE;
|
return Declarations::ACP_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('accepted_activitytypes', EntityType::class, [
|
$builder->add('accepted_activitytypes', EntityType::class, [
|
||||||
'class' => ActivityType::class,
|
'class' => ActivityType::class,
|
||||||
|
@ -28,7 +28,7 @@ class BySocialActionFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) {
|
if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) {
|
||||||
$qb->join('activity.socialActions', 'actsocialaction');
|
$qb->join('activity.socialActions', 'actsocialaction');
|
||||||
@ -48,7 +48,7 @@ class BySocialActionFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY_ACP;
|
return Declarations::ACTIVITY_ACP;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('accepted_socialactions', PickSocialActionType::class, [
|
$builder->add('accepted_socialactions', PickSocialActionType::class, [
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
@ -28,7 +28,7 @@ class BySocialIssueFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) {
|
if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) {
|
||||||
$qb->join('activity.socialIssues', 'actsocialissue');
|
$qb->join('activity.socialIssues', 'actsocialissue');
|
||||||
@ -48,7 +48,7 @@ class BySocialIssueFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY_ACP;
|
return Declarations::ACTIVITY_ACP;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('accepted_socialissues', PickSocialIssueType::class, [
|
$builder->add('accepted_socialissues', PickSocialIssueType::class, [
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
@ -27,7 +27,7 @@ class HasNoActivityFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$qb
|
$qb
|
||||||
->andWhere('
|
->andWhere('
|
||||||
@ -43,7 +43,7 @@ class HasNoActivityFilter implements FilterInterface
|
|||||||
return Declarations::ACP_TYPE;
|
return Declarations::ACP_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// no form needed
|
// no form needed
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
|
|||||||
return 'export.filter.activity.course_having_activity_between_date.Title';
|
return 'export.filter.activity.course_having_activity_between_date.Title';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('start_date', PickRollingDateType::class, [
|
->add('start_date', PickRollingDateType::class, [
|
||||||
@ -65,7 +65,7 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$alias = 'act_period_having_act_betw_date_alias';
|
$alias = 'act_period_having_act_betw_date_alias';
|
||||||
$from = 'act_period_having_act_betw_date_start';
|
$from = 'act_period_having_act_betw_date_start';
|
||||||
|
@ -30,7 +30,7 @@ class ActivityDateFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
$where = $qb->getDQLPart('where');
|
||||||
$clause = $qb->expr()->between(
|
$clause = $qb->expr()->between(
|
||||||
@ -61,7 +61,7 @@ class ActivityDateFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('date_from', PickRollingDateType::class, [
|
->add('date_from', PickRollingDateType::class, [
|
||||||
|
@ -33,7 +33,7 @@ final readonly class ActivityPresenceFilter implements FilterInterface
|
|||||||
return 'export.filter.activity.by_presence.Filter activity by activity presence';
|
return 'export.filter.activity.by_presence.Filter activity by activity presence';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('presences', EntityType::class, [
|
$builder->add('presences', EntityType::class, [
|
||||||
'class' => ActivityPresence::class,
|
'class' => ActivityPresence::class,
|
||||||
@ -68,7 +68,7 @@ final readonly class ActivityPresenceFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$qb
|
$qb
|
||||||
->andWhere('activity.attendee IN (:activity_presence_filter_presences)')
|
->andWhere('activity.attendee IN (:activity_presence_filter_presences)')
|
||||||
|
@ -34,7 +34,7 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$clause = $qb->expr()->in('activity.activityType', ':selected_activity_types');
|
$clause = $qb->expr()->in('activity.activityType', ':selected_activity_types');
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('types', EntityType::class, [
|
$builder->add('types', EntityType::class, [
|
||||||
'choices' => $this->activityTypeRepository->findAllActive(),
|
'choices' => $this->activityTypeRepository->findAllActive(),
|
||||||
@ -93,7 +93,7 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
|
|||||||
return 'Filter by activity type';
|
return 'Filter by activity type';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateForm($data, ExecutionContextInterface $context)
|
public function validateForm($data, ExecutionContextInterface $context): void
|
||||||
{
|
{
|
||||||
if (null === $data['types'] || 0 === \count($data['types'])) {
|
if (null === $data['types'] || 0 === \count($data['types'])) {
|
||||||
$context
|
$context
|
||||||
|
@ -27,7 +27,7 @@ class ActivityUsersFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$orX = $qb->expr()->orX();
|
$orX = $qb->expr()->orX();
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ class ActivityUsersFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('accepted_users', PickUserDynamicType::class, [
|
$builder->add('accepted_users', PickUserDynamicType::class, [
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
@ -27,7 +27,7 @@ class ByCreatorFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$qb
|
$qb
|
||||||
->andWhere(
|
->andWhere(
|
||||||
@ -41,7 +41,7 @@ class ByCreatorFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('accepted_users', PickUserDynamicType::class, [
|
$builder->add('accepted_users', PickUserDynamicType::class, [
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
@ -39,7 +39,7 @@ final readonly class CreatorJobFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ final readonly class CreatorJobFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('jobs', EntityType::class, [
|
->add('jobs', EntityType::class, [
|
||||||
|
@ -36,7 +36,7 @@ class CreatorScopeFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ class CreatorScopeFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('scopes', EntityType::class, [
|
->add('scopes', EntityType::class, [
|
||||||
|
@ -35,7 +35,7 @@ class EmergencyFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
$where = $qb->getDQLPart('where');
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ class EmergencyFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('accepted_emergency', ChoiceType::class, [
|
$builder->add('accepted_emergency', ChoiceType::class, [
|
||||||
'choices' => self::CHOICES,
|
'choices' => self::CHOICES,
|
||||||
|
@ -24,7 +24,7 @@ class LocationFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$qb->andWhere(
|
$qb->andWhere(
|
||||||
$qb->expr()->in('activity.location', ':location')
|
$qb->expr()->in('activity.location', ':location')
|
||||||
@ -38,7 +38,7 @@ class LocationFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('accepted_location', PickUserLocationType::class, [
|
$builder->add('accepted_location', PickUserLocationType::class, [
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
@ -28,7 +28,7 @@ class LocationTypeFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
|
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
|
||||||
$qb->join('activity.location', 'actloc');
|
$qb->join('activity.location', 'actloc');
|
||||||
@ -52,7 +52,7 @@ class LocationTypeFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('accepted_locationtype', PickLocationTypeType::class, [
|
$builder->add('accepted_locationtype', PickLocationTypeType::class, [
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
@ -33,7 +33,7 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
$where = $qb->getDQLPart('where');
|
||||||
$join = $qb->getDQLPart('join');
|
$join = $qb->getDQLPart('join');
|
||||||
@ -58,7 +58,7 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
|
|||||||
return Declarations::ACTIVITY_PERSON;
|
return Declarations::ACTIVITY_PERSON;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('reasons', EntityType::class, [
|
$builder->add('reasons', EntityType::class, [
|
||||||
'class' => ActivityReason::class,
|
'class' => ActivityReason::class,
|
||||||
@ -96,7 +96,7 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
|
|||||||
return 'Filter by reason';
|
return 'Filter by reason';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateForm($data, ExecutionContextInterface $context)
|
public function validateForm($data, ExecutionContextInterface $context): void
|
||||||
{
|
{
|
||||||
if (null === $data['reasons'] || 0 === \count($data['reasons'])) {
|
if (null === $data['reasons'] || 0 === \count($data['reasons'])) {
|
||||||
$context
|
$context
|
||||||
|
@ -92,7 +92,7 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
|
|||||||
return Declarations::PERSON_TYPE;
|
return Declarations::PERSON_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('date_from_rolling', PickRollingDateType::class, [
|
$builder->add('date_from_rolling', PickRollingDateType::class, [
|
||||||
'label' => 'export.filter.activity.person_between_dates.Implied in an activity after this date',
|
'label' => 'export.filter.activity.person_between_dates.Implied in an activity after this date',
|
||||||
@ -150,7 +150,7 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
|
|||||||
return 'export.filter.activity.person_between_dates.title';
|
return 'export.filter.activity.person_between_dates.title';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateForm($data, ExecutionContextInterface $context)
|
public function validateForm($data, ExecutionContextInterface $context): void
|
||||||
{
|
{
|
||||||
if ($this->rollingDateConverter->convert($data['date_from_rolling'])
|
if ($this->rollingDateConverter->convert($data['date_from_rolling'])
|
||||||
>= $this->rollingDateConverter->convert($data['date_to_rolling'])) {
|
>= $this->rollingDateConverter->convert($data['date_to_rolling'])) {
|
||||||
|
@ -33,7 +33,7 @@ final readonly class PersonsFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ final readonly class PersonsFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('accepted_persons', PickPersonDynamicType::class, [
|
$builder->add('accepted_persons', PickPersonDynamicType::class, [
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
@ -36,7 +36,7 @@ class SentReceivedFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
$where = $qb->getDQLPart('where');
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ class SentReceivedFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('accepted_sentreceived', ChoiceType::class, [
|
$builder->add('accepted_sentreceived', ChoiceType::class, [
|
||||||
'choices' => self::CHOICES,
|
'choices' => self::CHOICES,
|
||||||
|
@ -28,7 +28,7 @@ class UserFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
$where = $qb->getDQLPart('where');
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ class UserFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder->add('accepted_users', PickUserDynamicType::class, [
|
$builder->add('accepted_users', PickUserDynamicType::class, [
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
@ -37,7 +37,7 @@ class UsersJobFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ class UsersJobFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('jobs', EntityType::class, [
|
->add('jobs', EntityType::class, [
|
||||||
|
@ -37,7 +37,7 @@ class UsersScopeFilter implements FilterInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ class UsersScopeFilter implements FilterInterface
|
|||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('scopes', EntityType::class, [
|
->add('scopes', EntityType::class, [
|
||||||
|
@ -19,7 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
|
|
||||||
class ActivityReasonCategoryType extends AbstractType
|
class ActivityReasonCategoryType extends AbstractType
|
||||||
{
|
{
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('name', TranslatableStringFormType::class)
|
->add('name', TranslatableStringFormType::class)
|
||||||
@ -29,7 +29,7 @@ class ActivityReasonCategoryType extends AbstractType
|
|||||||
/**
|
/**
|
||||||
* @param OptionsResolverInterface $resolver
|
* @param OptionsResolverInterface $resolver
|
||||||
*/
|
*/
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
'data_class' => \Chill\ActivityBundle\Entity\ActivityReasonCategory::class,
|
'data_class' => \Chill\ActivityBundle\Entity\ActivityReasonCategory::class,
|
||||||
@ -39,7 +39,7 @@ class ActivityReasonCategoryType extends AbstractType
|
|||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix(): string
|
||||||
{
|
{
|
||||||
return 'chill_activitybundle_activityreasoncategory';
|
return 'chill_activitybundle_activityreasoncategory';
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
|
|
||||||
class ActivityReasonType extends AbstractType
|
class ActivityReasonType extends AbstractType
|
||||||
{
|
{
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('name', TranslatableStringFormType::class)
|
->add('name', TranslatableStringFormType::class)
|
||||||
@ -29,7 +29,7 @@ class ActivityReasonType extends AbstractType
|
|||||||
->add('category', TranslatableActivityReasonCategoryType::class);
|
->add('category', TranslatableActivityReasonCategoryType::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
'data_class' => ActivityReason::class,
|
'data_class' => ActivityReason::class,
|
||||||
@ -39,7 +39,7 @@ class ActivityReasonType extends AbstractType
|
|||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix(): string
|
||||||
{
|
{
|
||||||
return 'chill_activitybundle_activityreason';
|
return 'chill_activitybundle_activityreason';
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ class ActivityTypeType extends AbstractType
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
|
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('name', TranslatableStringFormType::class)
|
->add('name', TranslatableStringFormType::class)
|
||||||
@ -67,7 +67,7 @@ class ActivityTypeType extends AbstractType
|
|||||||
->add('commentVisible', ActivityFieldPresence::class);
|
->add('commentVisible', ActivityFieldPresence::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
'data_class' => \Chill\ActivityBundle\Entity\ActivityType::class,
|
'data_class' => \Chill\ActivityBundle\Entity\ActivityType::class,
|
||||||
|
@ -18,7 +18,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
|
|
||||||
class ActivityFieldPresence extends AbstractType
|
class ActivityFieldPresence extends AbstractType
|
||||||
{
|
{
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults(
|
$resolver->setDefaults(
|
||||||
[
|
[
|
||||||
@ -31,7 +31,7 @@ class ActivityFieldPresence extends AbstractType
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getParent()
|
public function getParent(): ?string
|
||||||
{
|
{
|
||||||
return ChoiceType::class;
|
return ChoiceType::class;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ class PickActivityReasonType extends AbstractType
|
|||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults(
|
$resolver->setDefaults(
|
||||||
[
|
[
|
||||||
@ -49,12 +49,12 @@ class PickActivityReasonType extends AbstractType
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix(): string
|
||||||
{
|
{
|
||||||
return 'translatable_activity_reason';
|
return 'translatable_activity_reason';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getParent()
|
public function getParent(): ?string
|
||||||
{
|
{
|
||||||
return EntityType::class;
|
return EntityType::class;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ class TranslatableActivityReasonCategoryType extends AbstractType
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) {}
|
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) {}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults(
|
$resolver->setDefaults(
|
||||||
[
|
[
|
||||||
@ -36,7 +36,7 @@ class TranslatableActivityReasonCategoryType extends AbstractType
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getParent()
|
public function getParent(): ?string
|
||||||
{
|
{
|
||||||
return EntityType::class;
|
return EntityType::class;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ class TranslatableActivityType extends AbstractType
|
|||||||
{
|
{
|
||||||
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected ActivityTypeRepositoryInterface $activityTypeRepository) {}
|
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected ActivityTypeRepositoryInterface $activityTypeRepository) {}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults(
|
$resolver->setDefaults(
|
||||||
[
|
[
|
||||||
@ -34,12 +34,12 @@ class TranslatableActivityType extends AbstractType
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix(): string
|
||||||
{
|
{
|
||||||
return 'translatable_activity_type';
|
return 'translatable_activity_type';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getParent()
|
public function getParent(): ?string
|
||||||
{
|
{
|
||||||
return EntityType::class;
|
return EntityType::class;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry,
|
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||||
{
|
{
|
||||||
$period = $parameters['accompanyingCourse'];
|
$period = $parameters['accompanyingCourse'];
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ final readonly class AccompanyingCourseQuickMenuBuilder implements LocalMenuBuil
|
|||||||
return ['accompanying_course_quick_menu'];
|
return ['accompanying_course_quick_menu'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||||
{
|
{
|
||||||
/** @var \Chill\PersonBundle\Entity\AccompanyingPeriod $accompanyingCourse */
|
/** @var \Chill\PersonBundle\Entity\AccompanyingPeriod $accompanyingCourse */
|
||||||
$accompanyingCourse = $parameters['accompanying-course'];
|
$accompanyingCourse = $parameters['accompanying-course'];
|
||||||
|
@ -22,7 +22,7 @@ final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private Security $security) {}
|
public function __construct(private Security $security) {}
|
||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||||
{
|
{
|
||||||
if (!$this->security->isGranted('ROLE_ADMIN')) {
|
if (!$this->security->isGranted('ROLE_ADMIN')) {
|
||||||
return;
|
return;
|
||||||
|
@ -30,7 +30,7 @@ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
private TranslatorInterface $translator,
|
private TranslatorInterface $translator,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||||
{
|
{
|
||||||
/** @var Person $person */
|
/** @var Person $person */
|
||||||
$person = $parameters['person'];
|
$person = $parameters['person'];
|
||||||
|
@ -49,17 +49,17 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierar
|
|||||||
return $this->getAttributes();
|
return $this->getAttributes();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function supports($attribute, $subject)
|
protected function supports(string $attribute, mixed $subject): bool
|
||||||
{
|
{
|
||||||
return $this->helper->supports($attribute, $subject);
|
return $this->helper->supports($attribute, $subject);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool
|
||||||
{
|
{
|
||||||
return $this->helper->voteOnAttribute($attribute, $subject, $token);
|
return $this->helper->voteOnAttribute($attribute, $subject, $token);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getAttributes()
|
private function getAttributes(): array
|
||||||
{
|
{
|
||||||
return [self::STATS, self::LISTS];
|
return [self::STATS, self::LISTS];
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ trait PrepareActivityTrait
|
|||||||
*
|
*
|
||||||
* @return Activity
|
* @return Activity
|
||||||
*/
|
*/
|
||||||
public function prepareActivity(Scope $scope, Person $person)
|
public function prepareActivity(Scope $scope, Person $person): \Chill\ActivityBundle\Entity\Activity
|
||||||
{
|
{
|
||||||
return (new Activity())
|
return (new Activity())
|
||||||
->setScope($scope)
|
->setScope($scope)
|
||||||
|
@ -75,7 +75,7 @@ final class ActivityControllerTest extends WebTestCase
|
|||||||
/**
|
/**
|
||||||
* @dataProvider getSecuredPagesUnauthenticated
|
* @dataProvider getSecuredPagesUnauthenticated
|
||||||
*/
|
*/
|
||||||
public function testAccessIsDeniedForUnauthenticated(mixed $url)
|
public function testAccessIsDeniedForUnauthenticated(mixed $url): void
|
||||||
{
|
{
|
||||||
$client = $this->createClient();
|
$client = $this->createClient();
|
||||||
|
|
||||||
@ -94,14 +94,14 @@ final class ActivityControllerTest extends WebTestCase
|
|||||||
* @param type $client
|
* @param type $client
|
||||||
* @param type $url
|
* @param type $url
|
||||||
*/
|
*/
|
||||||
public function testAccessIsDeniedForUnauthorized($client, $url)
|
public function testAccessIsDeniedForUnauthorized($client, $url): void
|
||||||
{
|
{
|
||||||
$client->request('GET', $url);
|
$client->request('GET', $url);
|
||||||
|
|
||||||
$this->assertEquals(403, $client->getResponse()->getStatusCode());
|
$this->assertEquals(403, $client->getResponse()->getStatusCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCompleteScenario()
|
public function testCompleteScenario(): void
|
||||||
{
|
{
|
||||||
// Create a new client to browse the application
|
// Create a new client to browse the application
|
||||||
$client = $this->getAuthenticatedClient();
|
$client = $this->getAuthenticatedClient();
|
||||||
@ -199,7 +199,7 @@ final class ActivityControllerTest extends WebTestCase
|
|||||||
*
|
*
|
||||||
* @return \Chill\MainBundle\Entity\User a fake user within a group without activity
|
* @return \Chill\MainBundle\Entity\User a fake user within a group without activity
|
||||||
*/
|
*/
|
||||||
private function createFakeUser()
|
private function createFakeUser(): \Chill\MainBundle\Entity\User
|
||||||
{
|
{
|
||||||
$container = self::$kernel->getContainer();
|
$container = self::$kernel->getContainer();
|
||||||
$em = $container->get('doctrine.orm.entity_manager');
|
$em = $container->get('doctrine.orm.entity_manager');
|
||||||
@ -259,7 +259,7 @@ final class ActivityControllerTest extends WebTestCase
|
|||||||
/**
|
/**
|
||||||
* @return \Symfony\Component\BrowserKit\AbstractBrowser
|
* @return \Symfony\Component\BrowserKit\AbstractBrowser
|
||||||
*/
|
*/
|
||||||
private function getAuthenticatedClient(mixed $username = 'center a_social')
|
private function getAuthenticatedClient(mixed $username = 'center a_social'): \Symfony\Bundle\FrameworkBundle\KernelBrowser
|
||||||
{
|
{
|
||||||
return self::createClient([], [
|
return self::createClient([], [
|
||||||
'PHP_AUTH_USER' => $username,
|
'PHP_AUTH_USER' => $username,
|
||||||
|
@ -41,7 +41,7 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
$this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
|
$this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByActivityTypeAggregator
|
||||||
{
|
{
|
||||||
return new ByActivityTypeAggregator(
|
return new ByActivityTypeAggregator(
|
||||||
$this->rollingDateConverter,
|
$this->rollingDateConverter,
|
||||||
|
@ -32,7 +32,7 @@ final class BySocialActionAggregatorTest extends AbstractAggregatorTest
|
|||||||
$this->aggregator = self::getContainer()->get('chill.activity.export.bysocialaction_aggregator');
|
$this->aggregator = self::getContainer()->get('chill.activity.export.bysocialaction_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ACPAggregators\BySocialActionAggregator
|
||||||
{
|
{
|
||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ final class BySocialIssueAggregatorTest extends AbstractAggregatorTest
|
|||||||
$this->aggregator = self::getContainer()->get('chill.activity.export.bysocialissue_aggregator');
|
$this->aggregator = self::getContainer()->get('chill.activity.export.bysocialissue_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ACPAggregators\BySocialIssueAggregator
|
||||||
{
|
{
|
||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class ActivityPresenceAggregatorTest extends AbstractAggregatorTest
|
|||||||
$this->activityPresenceRepository = self::getContainer()->get(ActivityPresenceRepositoryInterface::class);
|
$this->activityPresenceRepository = self::getContainer()->get(ActivityPresenceRepositoryInterface::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ActivityPresenceAggregator
|
||||||
{
|
{
|
||||||
return new ActivityPresenceAggregator($this->activityPresenceRepository, $this->translatableStringHelper);
|
return new ActivityPresenceAggregator($this->activityPresenceRepository, $this->translatableStringHelper);
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
|
|||||||
->push($request->reveal());*/
|
->push($request->reveal());*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator
|
||||||
{
|
{
|
||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
->push($request->reveal());
|
->push($request->reveal());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ActivityTypeAggregator
|
||||||
{
|
{
|
||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ final class ActivityUserAggregatorTest extends AbstractAggregatorTest
|
|||||||
->push($request->reveal());
|
->push($request->reveal());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ActivityUserAggregator
|
||||||
{
|
{
|
||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest
|
|||||||
$this->aggregator = self::getContainer()->get(ByThirdpartyAggregator::class);
|
$this->aggregator = self::getContainer()->get(ByThirdpartyAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ByThirdpartyAggregator
|
||||||
{
|
{
|
||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest
|
|||||||
$this->aggregator = self::getContainer()->get(ByCreatorAggregator::class);
|
$this->aggregator = self::getContainer()->get(ByCreatorAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ByCreatorAggregator
|
||||||
{
|
{
|
||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ final class CreatorJobAggregatorTest extends AbstractAggregatorTest
|
|||||||
$this->aggregator = self::getContainer()->get(CreatorJobAggregator::class);
|
$this->aggregator = self::getContainer()->get(CreatorJobAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\CreatorJobAggregator
|
||||||
{
|
{
|
||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ final class CreatorScopeAggregatorTest extends AbstractAggregatorTest
|
|||||||
$this->aggregator = self::getContainer()->get(CreatorScopeAggregator::class);
|
$this->aggregator = self::getContainer()->get(CreatorScopeAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\CreatorScopeAggregator
|
||||||
{
|
{
|
||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest
|
|||||||
$this->aggregator = self::getContainer()->get(DateAggregator::class);
|
$this->aggregator = self::getContainer()->get(DateAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\DateAggregator
|
||||||
{
|
{
|
||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
$this->aggregator = self::getContainer()->get(LocationTypeAggregator::class);
|
$this->aggregator = self::getContainer()->get(LocationTypeAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\LocationTypeAggregator
|
||||||
{
|
{
|
||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ class PersonAggregatorTest extends AbstractAggregatorTest
|
|||||||
$this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class);
|
$this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\PersonAggregators\PersonAggregator
|
||||||
{
|
{
|
||||||
return new PersonAggregator($this->labelPersonHelper);
|
return new PersonAggregator($this->labelPersonHelper);
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ class PersonsAggregatorTest extends AbstractAggregatorTest
|
|||||||
$this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class);
|
$this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\PersonsAggregator
|
||||||
{
|
{
|
||||||
return new PersonsAggregator($this->labelPersonHelper);
|
return new PersonsAggregator($this->labelPersonHelper);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
|
|||||||
$this->filter = self::getContainer()->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter::class);
|
$this->filter = self::getContainer()->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilter()
|
public function getFilter(): \Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter
|
||||||
{
|
{
|
||||||
return $this->filter;
|
return $this->filter;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ final class ByCreatorFilterTest extends AbstractFilterTest
|
|||||||
$this->filter = self::getContainer()->get(ByCreatorFilter::class);
|
$this->filter = self::getContainer()->get(ByCreatorFilter::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilter()
|
public function getFilter(): \Chill\ActivityBundle\Export\Filter\ByCreatorFilter
|
||||||
{
|
{
|
||||||
return $this->filter;
|
return $this->filter;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ final class BySocialActionFilterTest extends AbstractFilterTest
|
|||||||
$this->filter = self::getContainer()->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter::class);
|
$this->filter = self::getContainer()->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilter()
|
public function getFilter(): \Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter
|
||||||
{
|
{
|
||||||
return $this->filter;
|
return $this->filter;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user