mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-13 11:54:32 +02:00
Applied rector rules up to symfony 6.2
This commit is contained in:
parent
88ea920dfb
commit
a43af180a7
145 changed files with 563 additions and 889 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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!');
|
||||
|
|
|
@ -27,9 +27,4 @@ class ProjectBOMEntryCollectionType extends AbstractType
|
|||
'label' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'project_bom_entry_collection';
|
||||
}
|
||||
}
|
|
@ -87,10 +87,4 @@ class ProjectBOMEntryType extends AbstractType
|
|||
'data_class' => ProjectBOMEntry::class,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'project_bom_entry';
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue