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

@@ -22,16 +22,8 @@ use function in_array;
final class AgentAggregator implements AggregatorInterface
{
private UserRender $userRender;
private UserRepository $userRepository;
public function __construct(
UserRepository $userRepository,
UserRender $userRender
) {
$this->userRepository = $userRepository;
$this->userRender = $userRender;
public function __construct(private UserRepository $userRepository, private UserRender $userRender)
{
}
public function addRole(): ?string

View File

@@ -22,16 +22,8 @@ use function in_array;
class CancelReasonAggregator implements AggregatorInterface
{
private CancelReasonRepository $cancelReasonRepository;
private TranslatableStringHelper $translatableStringHelper;
public function __construct(
CancelReasonRepository $cancelReasonRepository,
TranslatableStringHelper $translatableStringHelper
) {
$this->cancelReasonRepository = $cancelReasonRepository;
$this->translatableStringHelper = $translatableStringHelper;
public function __construct(private CancelReasonRepository $cancelReasonRepository, private TranslatableStringHelper $translatableStringHelper)
{
}
public function addRole(): ?string

View File

@@ -22,16 +22,8 @@ use function in_array;
final class JobAggregator implements AggregatorInterface
{
private UserJobRepository $jobRepository;
private TranslatableStringHelper $translatableStringHelper;
public function __construct(
UserJobRepository $jobRepository,
TranslatableStringHelper $translatableStringHelper
) {
$this->jobRepository = $jobRepository;
$this->translatableStringHelper = $translatableStringHelper;
public function __construct(private UserJobRepository $jobRepository, private TranslatableStringHelper $translatableStringHelper)
{
}
public function addRole(): ?string

View File

@@ -21,12 +21,8 @@ use function in_array;
final class LocationAggregator implements AggregatorInterface
{
private LocationRepository $locationRepository;
public function __construct(
LocationRepository $locationRepository
) {
$this->locationRepository = $locationRepository;
public function __construct(private LocationRepository $locationRepository)
{
}
public function addRole(): ?string

View File

@@ -22,16 +22,8 @@ use function in_array;
final class LocationTypeAggregator implements AggregatorInterface
{
private LocationTypeRepository $locationTypeRepository;
private TranslatableStringHelper $translatableStringHelper;
public function __construct(
LocationTypeRepository $locationTypeRepository,
TranslatableStringHelper $translatableStringHelper
) {
$this->locationTypeRepository = $locationTypeRepository;
$this->translatableStringHelper = $translatableStringHelper;
public function __construct(private LocationTypeRepository $locationTypeRepository, private TranslatableStringHelper $translatableStringHelper)
{
}
public function addRole(): ?string

View File

@@ -22,16 +22,8 @@ use function in_array;
final class ScopeAggregator implements AggregatorInterface
{
private ScopeRepository $scopeRepository;
private TranslatableStringHelper $translatableStringHelper;
public function __construct(
ScopeRepository $scopeRepository,
TranslatableStringHelper $translatableStringHelper
) {
$this->scopeRepository = $scopeRepository;
$this->translatableStringHelper = $translatableStringHelper;
public function __construct(private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper)
{
}
public function addRole(): ?string

View File

@@ -28,12 +28,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class UrgencyAggregator implements AggregatorInterface
{
private TranslatorInterface $translator;
public function __construct(
TranslatorInterface $translator
) {
$this->translator = $translator;
public function __construct(private TranslatorInterface $translator)
{
}
public function addRole(): ?string
@@ -64,16 +60,11 @@ class UrgencyAggregator implements AggregatorInterface
return 'Urgency';
}
switch ($value) {
case true:
return $this->translator->trans('is urgent');
case false:
return $this->translator->trans('is not urgent');
default:
throw new LogicException(sprintf('The value %s is not valid', $value));
}
return match ($value) {
true => $this->translator->trans('is urgent'),
false => $this->translator->trans('is not urgent'),
default => throw new LogicException(sprintf('The value %s is not valid', $value)),
};
};
}

View File

@@ -25,11 +25,8 @@ use Symfony\Component\Validator\Exception\LogicException;
class CountCalendars implements ExportInterface, GroupedExportInterface
{
private CalendarRepository $calendarRepository;
public function __construct(CalendarRepository $calendarRepository)
public function __construct(private CalendarRepository $calendarRepository)
{
$this->calendarRepository = $calendarRepository;
}
public function buildForm(FormBuilderInterface $builder)

View File

@@ -24,12 +24,8 @@ use Symfony\Component\Form\FormBuilderInterface;
class StatCalendarAvgDuration implements ExportInterface, GroupedExportInterface
{
private CalendarRepository $calendarRepository;
public function __construct(
CalendarRepository $calendarRepository
) {
$this->calendarRepository = $calendarRepository;
public function __construct(private CalendarRepository $calendarRepository)
{
}
public function buildForm(FormBuilderInterface $builder): void

View File

@@ -24,12 +24,8 @@ use Symfony\Component\Form\FormBuilderInterface;
class StatCalendarSumDuration implements ExportInterface, GroupedExportInterface
{
private CalendarRepository $calendarRepository;
public function __construct(
CalendarRepository $calendarRepository
) {
$this->calendarRepository = $calendarRepository;
public function __construct(private CalendarRepository $calendarRepository)
{
}
public function buildForm(FormBuilderInterface $builder): void

View File

@@ -22,11 +22,8 @@ use Symfony\Component\Form\FormBuilderInterface;
class AgentFilter implements FilterInterface
{
private UserRender $userRender;
public function __construct(UserRender $userRender)
public function __construct(private UserRender $userRender)
{
$this->userRender = $userRender;
}
public function addRole(): ?string

View File

@@ -21,11 +21,8 @@ use Symfony\Component\Form\FormBuilderInterface;
class BetweenDatesFilter implements FilterInterface
{
private RollingDateConverterInterface $rollingDateConverter;
public function __construct(RollingDateConverterInterface $rollingDateConverter)
public function __construct(private RollingDateConverterInterface $rollingDateConverter)
{
$this->rollingDateConverter = $rollingDateConverter;
}
public function addRole(): ?string

View File

@@ -35,11 +35,8 @@ class CalendarRangeFilter implements FilterInterface
private const DEFAULT_CHOICE = false;
private TranslatorInterface $translator;
public function __construct(TranslatorInterface $translator)
public function __construct(private TranslatorInterface $translator)
{
$this->translator = $translator;
}
public function addRole(): ?string

View File

@@ -24,16 +24,8 @@ use function in_array;
class JobFilter implements FilterInterface
{
protected TranslatorInterface $translator;
private TranslatableStringHelper $translatableStringHelper;
public function __construct(
TranslatorInterface $translator,
TranslatableStringHelper $translatableStringHelper
) {
$this->translator = $translator;
$this->translatableStringHelper = $translatableStringHelper;
public function __construct(protected TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper)
{
}
public function addRole(): ?string

View File

@@ -24,16 +24,8 @@ use function in_array;
class ScopeFilter implements FilterInterface
{
protected TranslatorInterface $translator;
private TranslatableStringHelper $translatableStringHelper;
public function __construct(
TranslatorInterface $translator,
TranslatableStringHelper $translatableStringHelper
) {
$this->translator = $translator;
$this->translatableStringHelper = $translatableStringHelper;
public function __construct(protected TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper)
{
}
public function addRole(): ?string