php cs fixes after updating php cs fixer

This commit is contained in:
2024-01-10 10:31:25 +01:00
parent 60ede58af0
commit 3c8e59e088
682 changed files with 2097 additions and 882 deletions

View File

@@ -19,7 +19,9 @@ use Symfony\Component\Security\Core\Security;
final class PrivateCommentDataMapper extends AbstractType implements DataMapperInterface
{
public function __construct(private readonly Security $security) {}
public function __construct(private readonly Security $security)
{
}
public function mapDataToForms($viewData, $forms)
{

View File

@@ -16,7 +16,9 @@ use Symfony\Component\Form\DataMapperInterface;
class ScopePickerDataMapper implements DataMapperInterface
{
public function __construct(private readonly ?Scope $scope = null) {}
public function __construct(private readonly ?Scope $scope = null)
{
}
public function mapDataToForms($data, $forms)
{

View File

@@ -17,7 +17,9 @@ class CustomizeFormEvent extends \Symfony\Contracts\EventDispatcher\Event
{
final public const NAME = 'chill_main.customize_form';
public function __construct(protected string $type, protected FormBuilderInterface $builder) {}
public function __construct(protected string $type, protected FormBuilderInterface $builder)
{
}
public function getBuilder(): FormBuilderInterface
{

View File

@@ -24,7 +24,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
final class LocationFormType extends AbstractType
{
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -83,7 +83,7 @@ trait AppendScopeChoiceTypeTrait
{
$resolver
->setRequired(['center', 'role'])
->setAllowedTypes('center', \Chill\MainBundle\Entity\Center::class)
->setAllowedTypes('center', Center::class)
->setAllowedTypes('role', 'string');
}

View File

@@ -23,10 +23,10 @@ class ComposedGroupCenterType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('permissionsgroup', EntityType::class, [
'class' => \Chill\MainBundle\Entity\PermissionsGroup::class,
'class' => PermissionsGroup::class,
'choice_label' => static fn (PermissionsGroup $group) => $group->getName(),
])->add('center', EntityType::class, [
'class' => \Chill\MainBundle\Entity\Center::class,
'class' => Center::class,
'choice_label' => static fn (Center $center) => $center->getName(),
]);
}

View File

@@ -17,7 +17,9 @@ use Symfony\Component\Form\Exception\TransformationFailedException;
final readonly class AddressToIdDataTransformer implements DataTransformerInterface
{
public function __construct(private AddressRepository $addressRepository) {}
public function __construct(private AddressRepository $addressRepository)
{
}
public function reverseTransform($value)
{

View File

@@ -20,7 +20,9 @@ use Symfony\Component\Form\Exception\UnexpectedTypeException;
class CenterTransformer implements DataTransformerInterface
{
public function __construct(private readonly CenterRepository $centerRepository, private readonly bool $multiple = false) {}
public function __construct(private readonly CenterRepository $centerRepository, private readonly bool $multiple = false)
{
}
public function reverseTransform($id)
{

View File

@@ -22,7 +22,9 @@ use Symfony\Component\Serializer\SerializerInterface;
class EntityToJsonTransformer implements DataTransformerInterface
{
public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly bool $multiple, private readonly string $type) {}
public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly bool $multiple, private readonly string $type)
{
}
public function reverseTransform($value)
{

View File

@@ -17,7 +17,9 @@ use Symfony\Component\Form\DataTransformerInterface;
class MultipleObjectsToIdTransformer implements DataTransformerInterface
{
public function __construct(private readonly EntityManagerInterface $em, private readonly ?string $class = null) {}
public function __construct(private readonly EntityManagerInterface $em, private readonly ?string $class = null)
{
}
/**
* Transforms a string (id) to an object (item).

View File

@@ -17,7 +17,9 @@ use Symfony\Component\Form\Exception\TransformationFailedException;
class ObjectToIdTransformer implements DataTransformerInterface
{
public function __construct(private readonly EntityManagerInterface $em, private readonly ?string $class = null) {}
public function __construct(private readonly EntityManagerInterface $em, private readonly ?string $class = null)
{
}
/**
* Transforms a string (id) to an object.

View File

@@ -18,7 +18,9 @@ use Symfony\Component\Form\Exception\TransformationFailedException;
class PostalCodeToIdTransformer implements DataTransformerInterface
{
public function __construct(private readonly PostalCodeRepositoryInterface $postalCodeRepository) {}
public function __construct(private readonly PostalCodeRepositoryInterface $postalCodeRepository)
{
}
public function reverseTransform($value)
{

View File

@@ -18,7 +18,9 @@ use Symfony\Component\Form\Exception\TransformationFailedException;
class ScopeTransformer implements DataTransformerInterface
{
public function __construct(private readonly EntityManagerInterface $em) {}
public function __construct(private readonly EntityManagerInterface $em)
{
}
public function reverseTransform($id)
{

View File

@@ -19,7 +19,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class AggregatorType extends AbstractType
{
public function __construct() {}
public function __construct()
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -29,7 +29,9 @@ class ExportType extends AbstractType
final public const PICK_FORMATTER_KEY = 'pick_formatter';
public function __construct(private readonly ExportManager $exportManager, private readonly SortExportElement $sortExportElement) {}
public function __construct(private readonly ExportManager $exportManager, private readonly SortExportElement $sortExportElement)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -22,7 +22,9 @@ class FilterType extends AbstractType
{
final public const ENABLED_FIELD = 'enabled';
public function __construct() {}
public function __construct()
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -33,7 +33,8 @@ final class PickCenterType extends AbstractType
private readonly ExportManager $exportManager,
private readonly RegroupmentRepository $regroupmentRepository,
private readonly AuthorizationHelperForCurrentUserInterface $authorizationHelper
) {}
) {
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -41,7 +41,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
*/
final class PickAddressType extends AbstractType
{
public function __construct(private readonly AddressToIdDataTransformer $addressToIdDataTransformer, private readonly TranslatorInterface $translator) {}
public function __construct(private readonly AddressToIdDataTransformer $addressToIdDataTransformer, private readonly TranslatorInterface $translator)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -34,7 +34,9 @@ use function count;
*/
class PickCenterType extends AbstractType
{
public function __construct(protected AuthorizationHelperInterface $authorizationHelper, protected Security $security, protected CenterRepository $centerRepository) {}
public function __construct(protected AuthorizationHelperInterface $authorizationHelper, protected Security $security, protected CenterRepository $centerRepository)
{
}
/**
* add a data transformer if user can reach only one center.

View File

@@ -21,7 +21,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class PickCivilityType extends AbstractType
{
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper)
{
}
public function configureOptions(OptionsResolver $resolver)
{

View File

@@ -19,7 +19,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class PickLocationTypeType extends AbstractType
{
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper)
{
}
public function configureOptions(OptionsResolver $resolver)
{

View File

@@ -21,7 +21,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class PickPostalCodeType extends AbstractType
{
public function __construct(private readonly PostalCodeToIdTransformer $postalCodeToIdTransformer) {}
public function __construct(private readonly PostalCodeToIdTransformer $postalCodeToIdTransformer)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -27,7 +27,9 @@ use Symfony\Component\Serializer\SerializerInterface;
*/
class PickUserDynamicType extends AbstractType
{
public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer) {}
public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -20,7 +20,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class PickUserLocationType extends AbstractType
{
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly LocationRepository $locationRepository) {}
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly LocationRepository $locationRepository)
{
}
public function configureOptions(OptionsResolver $resolver)
{

View File

@@ -21,7 +21,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class PrivateCommentType extends AbstractType
{
public function __construct(protected PrivateCommentDataMapper $dataMapper) {}
public function __construct(protected PrivateCommentDataMapper $dataMapper)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -39,7 +39,9 @@ use Symfony\Component\Security\Core\Security;
*/
class ScopePickerType extends AbstractType
{
public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -26,7 +26,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
*/
class Select2CountryType extends AbstractType
{
public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) {}
public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
@@ -56,7 +58,7 @@ class Select2CountryType extends AbstractType
asort($choices, \SORT_STRING | \SORT_FLAG_CASE);
$resolver->setDefaults([
'class' => \Chill\MainBundle\Entity\Country::class,
'class' => Country::class,
'choices' => array_combine(array_values($choices), array_keys($choices)),
'preferred_choices' => array_combine(array_values($preferredChoices), array_keys($preferredChoices)),
]);

View File

@@ -26,7 +26,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
*/
class Select2LanguageType extends AbstractType
{
public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) {}
public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
@@ -52,7 +54,7 @@ class Select2LanguageType extends AbstractType
asort($choices, \SORT_STRING | \SORT_FLAG_CASE);
$resolver->setDefaults([
'class' => \Chill\MainBundle\Entity\Language::class,
'class' => Language::class,
'choices' => array_combine(array_values($choices), array_keys($choices)),
'preferred_choices' => array_combine(array_values($preferredChoices), array_keys($preferredChoices)),
]);

View File

@@ -36,7 +36,9 @@ use Symfony\Component\Validator\Constraints\Regex;
class UserType extends AbstractType
{
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) {}
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -34,11 +34,13 @@ use Symfony\Component\Workflow\Transition;
class WorkflowStepType extends AbstractType
{
public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Registry $registry, private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Registry $registry, private readonly TranslatableStringHelperInterface $translatableStringHelper)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
/** @var \Chill\MainBundle\Entity\Workflow\EntityWorkflow $entityWorkflow */
/** @var EntityWorkflow $entityWorkflow */
$entityWorkflow = $options['entity_workflow'];
$handler = $this->entityWorkflowManager->getHandler($entityWorkflow);
$workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());