DX: apply rector rules up to php8.0

This commit is contained in:
2023-04-15 01:05:37 +02:00
parent d8870e906f
commit dde3002100
714 changed files with 2348 additions and 9263 deletions

View File

@@ -18,11 +18,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class DateTimeHelper
{
private TranslatorInterface $translator;
public function __construct(TranslatorInterface $translator)
public function __construct(private TranslatorInterface $translator)
{
$this->translator = $translator;
}
public function getLabel($header): callable

View File

@@ -74,14 +74,6 @@ class ExportAddressHelper
'geographical_units' => ['_unit_names', '_unit_refs'],
];
private AddressRender $addressRender;
private AddressRepository $addressRepository;
private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository;
private TranslatableStringHelperInterface $translatableStringHelper;
/**
* @var array<string, string, GeographicalUnitLayer>>|null
*/
@@ -92,16 +84,8 @@ class ExportAddressHelper
*/
private ?array $unitRefsKeysCache = [];
public function __construct(
AddressRender $addressRender,
AddressRepository $addressRepository,
GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository,
TranslatableStringHelperInterface $translatableStringHelper
) {
$this->addressRepository = $addressRepository;
$this->geographicalUnitLayerRepository = $geographicalUnitLayerRepository;
$this->translatableStringHelper = $translatableStringHelper;
$this->addressRender = $addressRender;
public function __construct(private AddressRender $addressRender, private AddressRepository $addressRepository, private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private TranslatableStringHelperInterface $translatableStringHelper)
{
}
public function addSelectClauses(int $params, QueryBuilder $queryBuilder, $entityName = 'address', $prefix = 'add')
@@ -369,16 +353,11 @@ class ExportAddressHelper
$decodedValues = json_decode($value, true, 512, JSON_THROW_ON_ERROR);
switch (count($decodedValues)) {
case 0:
return '';
case 1:
return $decodedValues[0];
default:
return implode('|', $decodedValues);
}
return match (count($decodedValues)) {
0 => '',
1 => $decodedValues[0],
default => implode('|', $decodedValues),
};
};
}

View File

@@ -21,11 +21,8 @@ use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
*/
class TranslatableStringExportLabelHelper
{
private TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(TranslatableStringHelperInterface $translatableStringHelper)
public function __construct(private TranslatableStringHelperInterface $translatableStringHelper)
{
$this->translatableStringHelper = $translatableStringHelper;
}
public function getLabel(string $key, array $values, string $header)

View File

@@ -18,14 +18,8 @@ use const SORT_NUMERIC;
class UserHelper
{
private UserRender $userRender;
private UserRepositoryInterface $userRepository;
public function __construct(UserRender $userRender, UserRepositoryInterface $userRepository)
public function __construct(private UserRender $userRender, private UserRepositoryInterface $userRepository)
{
$this->userRender = $userRender;
$this->userRepository = $userRepository;
}
public function getLabel($key, array $values, string $header): callable