mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 17:15:02 +00:00
Rector changes and immplementations of required methods
This commit is contained in:
@@ -20,7 +20,7 @@ use Symfony\Component\Routing\Annotation\Route;
|
||||
class AdminController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/{_locale}/admin/aside-activity', name: 'chill_aside_activity_admin')]
|
||||
public function indexAdminAction()
|
||||
public function indexAdminAction(): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
return $this->render('@ChillAsideActivity/Admin/index.html.twig');
|
||||
}
|
||||
|
@@ -34,13 +34,13 @@ final class ChillAsideActivityExtension extends Extension implements PrependExte
|
||||
$loader->load('services/export.yaml');
|
||||
}
|
||||
|
||||
public function prepend(ContainerBuilder $container)
|
||||
public function prepend(ContainerBuilder $container): void
|
||||
{
|
||||
$this->prependRoute($container);
|
||||
$this->prependCruds($container);
|
||||
}
|
||||
|
||||
protected function prependCruds(ContainerBuilder $container)
|
||||
protected function prependCruds(ContainerBuilder $container): void
|
||||
{
|
||||
$container->prependExtensionConfig('chill_main', [
|
||||
'cruds' => [
|
||||
@@ -98,7 +98,7 @@ final class ChillAsideActivityExtension extends Extension implements PrependExte
|
||||
]);
|
||||
}
|
||||
|
||||
protected function prependRoute(ContainerBuilder $container)
|
||||
protected function prependRoute(ContainerBuilder $container): void
|
||||
{
|
||||
// declare routes for task bundle
|
||||
$container->prependExtensionConfig('chill_main', [
|
||||
|
@@ -101,7 +101,7 @@ class AsideActivityCategory
|
||||
}
|
||||
|
||||
#[Assert\Callback]
|
||||
public function preventRecursiveParent(ExecutionContextInterface $context, mixed $payload)
|
||||
public function preventRecursiveParent(ExecutionContextInterface $context, mixed $payload): void
|
||||
{
|
||||
if (!$this->hasParent()) {
|
||||
return;
|
||||
|
@@ -30,7 +30,7 @@ class ByActivityTypeAggregator implements AggregatorInterface
|
||||
return null;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
public function alterQuery(QueryBuilder $qb, $data): void
|
||||
{
|
||||
$qb->addSelect('IDENTITY(aside.type) AS by_aside_activity_type_aggregator')
|
||||
->addGroupBy('by_aside_activity_type_aggregator');
|
||||
@@ -41,7 +41,7 @@ class ByActivityTypeAggregator implements AggregatorInterface
|
||||
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
public function buildForm(FormBuilderInterface $builder): void
|
||||
{
|
||||
// No form needed
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ class ByUserJobAggregator implements AggregatorInterface
|
||||
return null;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
public function alterQuery(QueryBuilder $qb, $data): void
|
||||
{
|
||||
$p = self::PREFIX;
|
||||
|
||||
|
@@ -34,7 +34,7 @@ class ByUserScopeAggregator implements AggregatorInterface
|
||||
return null;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
public function alterQuery(QueryBuilder $qb, $data): void
|
||||
{
|
||||
$p = self::PREFIX;
|
||||
|
||||
|
@@ -44,7 +44,7 @@ final readonly class ListAsideActivity implements ListInterface, GroupedExportIn
|
||||
private TranslatableStringHelperInterface $translatableStringHelper,
|
||||
) {}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder) {}
|
||||
public function buildForm(FormBuilderInterface $builder): void {}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
{
|
||||
|
@@ -35,7 +35,7 @@ class ByActivityTypeFilter implements FilterInterface
|
||||
return null;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
public function alterQuery(QueryBuilder $qb, $data): void
|
||||
{
|
||||
$clause = $qb->expr()->in('aside.type', ':types');
|
||||
|
||||
@@ -48,7 +48,7 @@ class ByActivityTypeFilter implements FilterInterface
|
||||
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
public function buildForm(FormBuilderInterface $builder): void
|
||||
{
|
||||
$builder
|
||||
->add('types', EntityType::class, [
|
||||
|
@@ -29,7 +29,7 @@ class ByDateFilter implements FilterInterface
|
||||
return null;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
public function alterQuery(QueryBuilder $qb, $data): void
|
||||
{
|
||||
$clause = $qb->expr()->between(
|
||||
'aside.date',
|
||||
@@ -53,7 +53,7 @@ class ByDateFilter implements FilterInterface
|
||||
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
public function buildForm(FormBuilderInterface $builder): void
|
||||
{
|
||||
$builder
|
||||
->add('date_from', PickRollingDateType::class, [
|
||||
|
@@ -27,7 +27,7 @@ class ByUserFilter implements FilterInterface
|
||||
return null;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
public function alterQuery(QueryBuilder $qb, $data): void
|
||||
{
|
||||
$clause = $qb->expr()->in('aside.agent', ':users');
|
||||
|
||||
@@ -41,7 +41,7 @@ class ByUserFilter implements FilterInterface
|
||||
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
public function buildForm(FormBuilderInterface $builder): void
|
||||
{
|
||||
$builder->add('accepted_users', PickUserDynamicType::class, [
|
||||
'multiple' => true,
|
||||
|
@@ -37,7 +37,7 @@ class ByUserJobFilter implements FilterInterface
|
||||
return null;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
public function alterQuery(QueryBuilder $qb, $data): void
|
||||
{
|
||||
$p = self::PREFIX;
|
||||
|
||||
@@ -65,7 +65,7 @@ class ByUserJobFilter implements FilterInterface
|
||||
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
public function buildForm(FormBuilderInterface $builder): void
|
||||
{
|
||||
$builder
|
||||
->add('jobs', EntityType::class, [
|
||||
|
@@ -37,7 +37,7 @@ class ByUserScopeFilter implements FilterInterface
|
||||
return null;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
public function alterQuery(QueryBuilder $qb, $data): void
|
||||
{
|
||||
$p = self::PREFIX;
|
||||
|
||||
@@ -65,7 +65,7 @@ class ByUserScopeFilter implements FilterInterface
|
||||
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
public function buildForm(FormBuilderInterface $builder): void
|
||||
{
|
||||
$builder
|
||||
->add('scopes', EntityType::class, [
|
||||
|
@@ -24,7 +24,7 @@ final class AsideActivityCategoryType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly CategoryRender $categoryRender) {}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder->add(
|
||||
'title',
|
||||
|
@@ -36,7 +36,7 @@ final class AsideActivityFormType extends AbstractType
|
||||
$this->timeChoices = $parameterBag->get('chill_aside_activity.form.time_duration');
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$timeChoices = [];
|
||||
|
||||
|
@@ -22,7 +22,7 @@ final class PickAsideActivityCategoryType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly CategoryRender $categoryRender) {}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver
|
||||
->setDefaults([
|
||||
|
@@ -18,7 +18,7 @@ final readonly class AdminMenuBuilder implements \Chill\MainBundle\Routing\Local
|
||||
{
|
||||
public function __construct(private Security $security) {}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||
{
|
||||
// all the entries below must have ROLE_ADMIN permissions
|
||||
if (!$this->security->isGranted('ROLE_ADMIN')) {
|
||||
|
@@ -23,7 +23,7 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
public function __construct(protected TranslatorInterface $translator, public AuthorizationCheckerInterface $authorizationChecker) {}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||
{
|
||||
if ($this->authorizationChecker->isGranted('ROLE_USER')) {
|
||||
$menu->addChild($this->translator->trans('Create an aside activity'), [
|
||||
|
@@ -52,7 +52,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||
{
|
||||
if ($this->authorizationChecker->isGranted('ROLE_USER')) {
|
||||
$menu->addChild('My aside activities', [
|
||||
|
@@ -58,7 +58,7 @@ class AsideActivityVoter extends AbstractChillVoter implements ProvideRoleHierar
|
||||
return $this->getAttributes();
|
||||
}
|
||||
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
return $this->voterHelper->supports($attribute, $subject);
|
||||
}
|
||||
|
@@ -61,7 +61,7 @@ final class AsideActivityControllerTest extends WebTestCase
|
||||
/**
|
||||
* @dataProvider generateAsideActivityId
|
||||
*/
|
||||
public function testEditWithoutUsers(int $asideActivityId)
|
||||
public function testEditWithoutUsers(int $asideActivityId): void
|
||||
{
|
||||
self::ensureKernelShutdown();
|
||||
$client = $this->getClientAuthenticated();
|
||||
@@ -70,7 +70,7 @@ final class AsideActivityControllerTest extends WebTestCase
|
||||
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
||||
}
|
||||
|
||||
public function testIndexWithoutUsers()
|
||||
public function testIndexWithoutUsers(): void
|
||||
{
|
||||
self::ensureKernelShutdown();
|
||||
$client = $this->getClientAuthenticated();
|
||||
@@ -79,7 +79,7 @@ final class AsideActivityControllerTest extends WebTestCase
|
||||
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
||||
}
|
||||
|
||||
public function testNewWithoutUsers()
|
||||
public function testNewWithoutUsers(): void
|
||||
{
|
||||
self::ensureKernelShutdown();
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
Reference in New Issue
Block a user