mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
apply rules rector up to php82
This commit is contained in:
@@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
final class AsideActivityController extends CRUDController
|
||||
{
|
||||
public function __construct(private AsideActivityCategoryRepository $categoryRepository)
|
||||
public function __construct(private readonly AsideActivityCategoryRepository $categoryRepository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -24,7 +24,7 @@ use function random_int;
|
||||
|
||||
class LoadAsideActivity extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
public function __construct(private UserRepository $userRepository)
|
||||
public function __construct(private readonly UserRepository $userRepository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByActivityTypeAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private AsideActivityCategoryRepository $asideActivityCategoryRepository, private TranslatableStringHelper $translatableStringHelper)
|
||||
public function __construct(private readonly AsideActivityCategoryRepository $asideActivityCategoryRepository, private readonly TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use function in_array;
|
||||
|
||||
class ByUserJobAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private UserJobRepositoryInterface $userJobRepository, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private readonly UserJobRepositoryInterface $userJobRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use function in_array;
|
||||
|
||||
class ByUserScopeAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -16,5 +16,5 @@ namespace Chill\AsideActivityBundle\Export;
|
||||
*/
|
||||
abstract class Declarations
|
||||
{
|
||||
public const ASIDE_ACTIVITY_TYPE = 'aside_activity';
|
||||
final public const ASIDE_ACTIVITY_TYPE = 'aside_activity';
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class AvgAsideActivityDuration implements ExportInterface, GroupedExportInterface
|
||||
{
|
||||
public function __construct(private AsideActivityRepository $repository)
|
||||
public function __construct(private readonly AsideActivityRepository $repository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class CountAsideActivity implements ExportInterface, GroupedExportInterface
|
||||
{
|
||||
public function __construct(private AsideActivityRepository $repository)
|
||||
public function __construct(private readonly AsideActivityRepository $repository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -32,7 +32,7 @@ use Doctrine\ORM\QueryBuilder;
|
||||
use LogicException;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final class ListAsideActivity implements ListInterface, GroupedExportInterface
|
||||
final readonly class ListAsideActivity implements ListInterface, GroupedExportInterface
|
||||
{
|
||||
public function __construct(private EntityManagerInterface $em, private DateTimeHelper $dateTimeHelper, private UserHelper $userHelper, private ScopeRepositoryInterface $scopeRepository, private CenterRepositoryInterface $centerRepository, private AsideActivityCategoryRepository $asideActivityCategoryRepository, private CategoryRender $categoryRender, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
|
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class SumAsideActivityDuration implements ExportInterface, GroupedExportInterface
|
||||
{
|
||||
public function __construct(private AsideActivityRepository $repository)
|
||||
public function __construct(private readonly AsideActivityRepository $repository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByActivityTypeFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private CategoryRender $categoryRender, private TranslatableStringHelperInterface $translatableStringHelper, private AsideActivityCategoryRepository $asideActivityTypeRepository)
|
||||
public function __construct(private readonly CategoryRender $categoryRender, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly AsideActivityCategoryRepository $asideActivityTypeRepository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class ByDateFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private RollingDateConverterInterface $rollingDateConverter, protected TranslatorInterface $translator)
|
||||
public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, protected TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByUserFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private UserRender $userRender)
|
||||
public function __construct(private readonly UserRender $userRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByUserJobFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByUserScopeFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final class AsideActivityCategoryType extends AbstractType
|
||||
{
|
||||
public function __construct(private CategoryRender $categoryRender)
|
||||
public function __construct(private readonly CategoryRender $categoryRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -33,7 +33,7 @@ use function in_array;
|
||||
|
||||
final class AsideActivityFormType extends AbstractType
|
||||
{
|
||||
private array $timeChoices;
|
||||
private readonly array $timeChoices;
|
||||
|
||||
public function __construct(
|
||||
ParameterBagInterface $parameterBag,
|
||||
@@ -105,13 +105,7 @@ final class AsideActivityFormType extends AbstractType
|
||||
if (!in_array($data->getTimestamp(), $timeChoices, true)) {
|
||||
// the data are not in the possible values. add them
|
||||
$timeChoices[$data->format('H:i')] = $data->getTimestamp();
|
||||
$form = $builder->create($fieldName, ChoiceType::class, array_merge(
|
||||
$durationTimeOptions,
|
||||
[
|
||||
'choices' => $timeChoices,
|
||||
'auto_initialize' => false,
|
||||
]
|
||||
));
|
||||
$form = $builder->create($fieldName, ChoiceType::class, [...$durationTimeOptions, 'choices' => $timeChoices, 'auto_initialize' => false]);
|
||||
$form->addModelTransformer($durationTimeTransformer);
|
||||
$formEvent->getForm()->getParent()->add($form->getForm());
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
final class PickAsideActivityCategoryType extends AbstractType
|
||||
{
|
||||
public function __construct(private CategoryRender $categoryRender)
|
||||
public function __construct(private readonly CategoryRender $categoryRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@ namespace Chill\AsideActivityBundle\Menu;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
|
||||
final readonly class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
|
||||
{
|
||||
public function __construct(private Security $security)
|
||||
{
|
||||
|
@@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectRepository;
|
||||
|
||||
class AsideActivityCategoryRepository implements ObjectRepository
|
||||
{
|
||||
private EntityRepository $repository;
|
||||
private readonly EntityRepository $repository;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager)
|
||||
{
|
||||
|
@@ -21,9 +21,9 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
|
||||
class AsideActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
{
|
||||
public const STATS = 'CHILL_ASIDE_ACTIVITY_STATS';
|
||||
final public const STATS = 'CHILL_ASIDE_ACTIVITY_STATS';
|
||||
|
||||
private VoterHelperInterface $voterHelper;
|
||||
private readonly VoterHelperInterface $voterHelper;
|
||||
|
||||
public function __construct(
|
||||
VoterHelperFactoryInterface $voterHelperFactory
|
||||
|
@@ -19,7 +19,7 @@ use Symfony\Component\Templating\EngineInterface;
|
||||
/**
|
||||
* @implements ChillEntityRenderInterface<AsideActivityCategory>
|
||||
*/
|
||||
final class CategoryRender implements ChillEntityRenderInterface
|
||||
final readonly class CategoryRender implements ChillEntityRenderInterface
|
||||
{
|
||||
public const DEFAULT_ARGS = [
|
||||
self::SEPERATOR_KEY => ' > ',
|
||||
|
Reference in New Issue
Block a user