Applied rector rules up to symfony 6.2

This commit is contained in:
Jan Böhmer 2023-05-28 01:21:05 +02:00
parent 88ea920dfb
commit a43af180a7
145 changed files with 563 additions and 889 deletions

View file

@ -34,7 +34,7 @@ class AttachmentTypeAdminForm extends BaseEntityAdminForm
{
protected FileTypeFilterTools $filterTools;
public function __construct(Security $security, FileTypeFilterTools $filterTools, EventCommentNeededHelper $eventCommentNeededHelper)
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, FileTypeFilterTools $filterTools, EventCommentNeededHelper $eventCommentNeededHelper)
{
$this->filterTools = $filterTools;
parent::__construct($security, $eventCommentNeededHelper);

View file

@ -44,10 +44,10 @@ use Symfony\Component\Security\Core\Security;
class BaseEntityAdminForm extends AbstractType
{
protected Security $security;
protected \Symfony\Bundle\SecurityBundle\Security $security;
protected EventCommentNeededHelper $eventCommentNeededHelper;
public function __construct(Security $security, EventCommentNeededHelper $eventCommentNeededHelper)
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, EventCommentNeededHelper $eventCommentNeededHelper)
{
$this->security = $security;
$this->eventCommentNeededHelper = $eventCommentNeededHelper;

View file

@ -34,7 +34,7 @@ class CurrencyAdminForm extends BaseEntityAdminForm
{
private string $default_currency;
public function __construct(Security $security, EventCommentNeededHelper $eventCommentNeededHelper, string $default_currency)
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, EventCommentNeededHelper $eventCommentNeededHelper, string $default_currency)
{
parent::__construct($security, $eventCommentNeededHelper);
$this->default_currency = $default_currency;

View file

@ -37,9 +37,9 @@ use Symfony\Component\Security\Core\Security;
class ImportType extends AbstractType
{
protected Security $security;
protected \Symfony\Bundle\SecurityBundle\Security $security;
public function __construct(Security $security)
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security)
{
$this->security = $security;
}

View file

@ -32,9 +32,9 @@ use Symfony\Component\Security\Core\Security;
class MassCreationForm extends AbstractType
{
protected Security $security;
protected \Symfony\Bundle\SecurityBundle\Security $security;
public function __construct(Security $security)
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security)
{
$this->security = $security;
}

View file

@ -34,7 +34,7 @@ class SupplierForm extends CompanyForm
{
protected string $default_currency;
public function __construct(Security $security, EventCommentNeededHelper $eventCommentNeededHelper, string $default_currency)
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, EventCommentNeededHelper $eventCommentNeededHelper, string $default_currency)
{
parent::__construct($security, $eventCommentNeededHelper);
$this->default_currency = $default_currency;

View file

@ -52,12 +52,12 @@ class AttachmentFormType extends AbstractType
protected UrlGeneratorInterface $urlGenerator;
protected bool $allow_attachments_download;
protected string $max_file_size;
protected Security $security;
protected \Symfony\Bundle\SecurityBundle\Security $security;
protected AttachmentSubmitHandler $submitHandler;
protected TranslatorInterface $translator;
public function __construct(AttachmentManager $attachmentHelper, UrlGeneratorInterface $urlGenerator,
Security $security, AttachmentSubmitHandler $submitHandler, TranslatorInterface $translator,
\Symfony\Bundle\SecurityBundle\Security $security, AttachmentSubmitHandler $submitHandler, TranslatorInterface $translator,
bool $allow_attachments_downloads, string $max_file_size)
{
$this->attachment_helper = $attachmentHelper;

View file

@ -53,9 +53,9 @@ use Symfony\Component\Security\Core\Security;
class LabelOptionsType extends AbstractType
{
private Security $security;
private \Symfony\Bundle\SecurityBundle\Security $security;
public function __construct(Security $security)
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security)
{
$this->security = $security;
}

View file

@ -52,9 +52,9 @@ use Symfony\Component\Security\Core\Security;
class LabelDialogType extends AbstractType
{
protected Security $security;
protected \Symfony\Bundle\SecurityBundle\Security $security;
public function __construct(Security $security)
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security)
{
$this->security = $security;
}

View file

@ -40,9 +40,9 @@ use Symfony\Component\Security\Core\Security;
class OrderdetailType extends AbstractType
{
protected Security $security;
protected \Symfony\Bundle\SecurityBundle\Security $security;
public function __construct(Security $security)
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security)
{
$this->security = $security;
}

View file

@ -52,11 +52,11 @@ use Symfony\Component\Security\Core\Security;
class PartBaseType extends AbstractType
{
protected Security $security;
protected \Symfony\Bundle\SecurityBundle\Security $security;
protected UrlGeneratorInterface $urlGenerator;
protected EventCommentNeededHelper $event_comment_needed_helper;
public function __construct(Security $security, UrlGeneratorInterface $urlGenerator, EventCommentNeededHelper $event_comment_needed_helper)
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, UrlGeneratorInterface $urlGenerator, EventCommentNeededHelper $event_comment_needed_helper)
{
$this->security = $security;
$this->urlGenerator = $urlGenerator;

View file

@ -38,9 +38,9 @@ use Symfony\Component\Security\Core\Security;
class PartLotType extends AbstractType
{
protected Security $security;
protected \Symfony\Bundle\SecurityBundle\Security $security;
public function __construct(Security $security)
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security)
{
$this->security = $security;
}

View file

@ -52,7 +52,7 @@ final class PermissionsMapper implements DataMapperInterface
* @param mixed $viewData View data of the compound form being initialized
* @param FormInterface[]|Traversable $forms A list of {@link FormInterface} instances
*/
public function mapDataToForms($viewData, $forms): void
public function mapDataToForms($viewData, \Traversable $forms): void
{
foreach ($forms as $form) {
if ($this->inherit) {
@ -99,7 +99,7 @@ final class PermissionsMapper implements DataMapperInterface
* @param mixed $viewData The compound form's view data that get mapped
* its children model data
*/
public function mapFormsToData($forms, &$viewData): void
public function mapFormsToData(\Traversable $forms, &$viewData): void
{
if ($this->inherit) {
throw new RuntimeException('The permission type is readonly when it is showing read only data!');

View file

@ -27,9 +27,4 @@ class ProjectBOMEntryCollectionType extends AbstractType
'label' => false,
]);
}
public function getBlockPrefix(): string
{
return 'project_bom_entry_collection';
}
}

View file

@ -87,10 +87,4 @@ class ProjectBOMEntryType extends AbstractType
'data_class' => ProjectBOMEntry::class,
]);
}
public function getBlockPrefix(): string
{
return 'project_bom_entry';
}
}

View file

@ -38,9 +38,9 @@ use Symfony\Component\Security\Core\Security;
class ProjectBuildType extends AbstractType implements DataMapperInterface
{
private Security $security;
private \Symfony\Bundle\SecurityBundle\Security $security;
public function __construct(Security $security)
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security)
{
$this->security = $security;
}

View file

@ -117,18 +117,13 @@ class PartSelectType extends AbstractType implements DataMapperInterface
]);
}
public function getBlockPrefix(): string
{
return 'part_select';
}
public function mapDataToForms($data, $forms)
public function mapDataToForms($data, \Traversable $forms)
{
$form = current(iterator_to_array($forms, false));
$form->setData($data);
}
public function mapFormsToData($forms, &$data)
public function mapFormsToData(\Traversable $forms, &$data)
{
$form = current(iterator_to_array($forms, false));
$data = $form->getData();

View file

@ -39,11 +39,6 @@ class RichTextEditorType extends AbstractType
}
public function getBlockPrefix(): string
{
return 'rich_text_editor';
}
public function finishView(FormView $view, FormInterface $form, array $options)
{
$view->vars['attr'] = array_merge($view->vars['attr'], $this->optionsToAttrArray($options));

View file

@ -156,7 +156,7 @@ final class SIUnitType extends AbstractType implements DataMapperInterface
*
* @throws Exception\UnexpectedTypeException if the type of the data parameter is not supported
*/
public function mapDataToForms($viewData, $forms): void
public function mapDataToForms($viewData, \Traversable $forms): void
{
$forms = iterator_to_array($forms);
@ -207,7 +207,7 @@ final class SIUnitType extends AbstractType implements DataMapperInterface
*
* @throws Exception\UnexpectedTypeException if the type of the data parameter is not supported
*/
public function mapFormsToData($forms, &$viewData): void
public function mapFormsToData(\Traversable $forms, &$viewData): void
{
//Convert both fields to a single float value.

View file

@ -48,9 +48,9 @@ use Symfony\Component\Validator\Constraints\Length;
class UserAdminForm extends AbstractType
{
protected Security $security;
protected \Symfony\Bundle\SecurityBundle\Security $security;
public function __construct(Security $security)
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security)
{
$this->security = $security;
}

View file

@ -44,10 +44,10 @@ use Symfony\Component\Validator\Constraints\File;
class UserSettingsType extends AbstractType
{
protected Security $security;
protected \Symfony\Bundle\SecurityBundle\Security $security;
protected bool $demo_mode;
public function __construct(Security $security, bool $demo_mode)
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, bool $demo_mode)
{
$this->security = $security;
$this->demo_mode = $demo_mode;