mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Merge branch 'master' into upgrade-sf5
This commit is contained in:
@@ -25,7 +25,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
abstract class AbstractElementController extends AbstractController
|
||||
{
|
||||
public function __construct(protected EntityManagerInterface $em, protected TranslatorInterface $translator, protected LoggerInterface $chillMainLogger, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||
public function __construct(protected EntityManagerInterface $em, protected TranslatorInterface $translator, protected LoggerInterface $chillMainLogger)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Route(
|
||||
|
@@ -21,7 +21,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
|
||||
class ElementController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly CalculatorManager $calculator, private readonly ResourceRepository $resourceRepository, private readonly ChargeRepository $chargeRepository) {}
|
||||
public function __construct(private readonly CalculatorManager $calculator, private readonly ResourceRepository $resourceRepository, private readonly ChargeRepository $chargeRepository)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @\Symfony\Component\Routing\Annotation\Route("{_locale}/budget/elements/by-person/{id}", name="chill_budget_elements_index")
|
||||
|
@@ -132,14 +132,14 @@ abstract class AbstractElement
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setComment(string $comment = null): self
|
||||
public function setComment(?string $comment = null): self
|
||||
{
|
||||
$this->comment = $comment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setEndDate(\DateTimeInterface $endDate = null): self
|
||||
public function setEndDate(?\DateTimeInterface $endDate = null): self
|
||||
{
|
||||
if ($endDate instanceof \DateTime) {
|
||||
$this->endDate = \DateTimeImmutable::createFromMutable($endDate);
|
||||
|
@@ -27,7 +27,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class ChargeType extends AbstractType
|
||||
{
|
||||
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ChargeKindRepository $repository, private readonly TranslatorInterface $translator) {}
|
||||
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ChargeKindRepository $repository, private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -26,7 +26,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class ResourceType extends AbstractType
|
||||
{
|
||||
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ResourceKindRepository $repository, private readonly TranslatorInterface $translator) {}
|
||||
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ResourceKindRepository $repository, private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -17,7 +17,9 @@ use Symfony\Component\Security\Core\Security;
|
||||
|
||||
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)
|
||||
{
|
||||
|
@@ -20,7 +20,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class HouseholdMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator) {}
|
||||
public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
|
@@ -20,7 +20,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator) {}
|
||||
public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
|
@@ -66,7 +66,7 @@ final class ChargeKindRepository implements ChargeKindRepositoryInterface
|
||||
*
|
||||
* @return array<ChargeKind>
|
||||
*/
|
||||
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array
|
||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
|
||||
{
|
||||
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ interface ChargeKindRepositoryInterface extends ObjectRepository
|
||||
/**
|
||||
* @return array<ChargeKind>
|
||||
*/
|
||||
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array;
|
||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array;
|
||||
|
||||
public function findOneBy(array $criteria): ?ChargeKind;
|
||||
|
||||
|
@@ -71,7 +71,7 @@ final class ResourceKindRepository implements ResourceKindRepositoryInterface
|
||||
*
|
||||
* @return list<ResourceKind>
|
||||
*/
|
||||
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array
|
||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
|
||||
{
|
||||
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ interface ResourceKindRepositoryInterface extends ObjectRepository
|
||||
/**
|
||||
* @return list<ResourceKind>
|
||||
*/
|
||||
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array;
|
||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array;
|
||||
|
||||
public function findOneBy(array $criteria): ?ResourceKind;
|
||||
|
||||
|
@@ -34,7 +34,9 @@ final readonly class SummaryBudget implements SummaryBudgetInterface
|
||||
|
||||
private const QUERY_RESOURCE_BY_PERSON = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, resource_id AS kind_id FROM chill_budget.resource WHERE person_id = ? AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY resource_id';
|
||||
|
||||
public function __construct(private EntityManagerInterface $em, private TranslatableStringHelperInterface $translatableStringHelper, private ResourceKindRepositoryInterface $resourceKindRepository, private ChargeKindRepositoryInterface $chargeKindRepository) {}
|
||||
public function __construct(private EntityManagerInterface $em, private TranslatableStringHelperInterface $translatableStringHelper, private ResourceKindRepositoryInterface $resourceKindRepository, private ChargeKindRepositoryInterface $chargeKindRepository)
|
||||
{
|
||||
}
|
||||
|
||||
public function getSummaryForHousehold(?Household $household): array
|
||||
{
|
||||
|
@@ -21,7 +21,9 @@ use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||
*/
|
||||
final readonly class BudgetElementTypeRender implements ChillEntityRenderInterface
|
||||
{
|
||||
public function __construct(private TranslatableStringHelperInterface $translatableStringHelper, private \Twig\Environment $engine) {}
|
||||
public function __construct(private TranslatableStringHelperInterface $translatableStringHelper, private \Twig\Environment $engine)
|
||||
{
|
||||
}
|
||||
|
||||
public function renderBox($entity, array $options): string
|
||||
{
|
||||
|
@@ -32,7 +32,7 @@ final class Version20221207105407 extends AbstractMigration implements Container
|
||||
return 'Use new budget admin entities';
|
||||
}
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
public function setContainer(?ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
Reference in New Issue
Block a user