Merge branch 'master' into upgrade-sf5

This commit is contained in:
2024-02-12 21:50:34 +01:00
920 changed files with 6430 additions and 1914 deletions

View File

@@ -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(

View File

@@ -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")

View File

@@ -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);

View File

@@ -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)
{

View File

@@ -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)
{

View File

@@ -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)
{

View File

@@ -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)
{

View File

@@ -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)
{

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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;
}