mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-16 16:09:31 +00:00
Applied rector with PHP8.1 migration rules
This commit is contained in:
parent
dc6a67c2f0
commit
7ee01d9a05
303 changed files with 1228 additions and 3465 deletions
|
|
@ -32,11 +32,8 @@ use Symfony\Component\Security\Core\Security;
|
|||
|
||||
class AttachmentTypeAdminForm extends BaseEntityAdminForm
|
||||
{
|
||||
protected FileTypeFilterTools $filterTools;
|
||||
|
||||
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, FileTypeFilterTools $filterTools, EventCommentNeededHelper $eventCommentNeededHelper)
|
||||
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, protected FileTypeFilterTools $filterTools, EventCommentNeededHelper $eventCommentNeededHelper)
|
||||
{
|
||||
$this->filterTools = $filterTools;
|
||||
parent::__construct($security, $eventCommentNeededHelper);
|
||||
}
|
||||
|
||||
|
|
@ -58,12 +55,8 @@ class AttachmentTypeAdminForm extends BaseEntityAdminForm
|
|||
|
||||
//Normalize data before writing it to database
|
||||
$builder->get('filetype_filter')->addViewTransformer(new CallbackTransformer(
|
||||
static function ($value) {
|
||||
return $value;
|
||||
},
|
||||
function ($value) {
|
||||
return $this->filterTools->normalizeFilterString($value);
|
||||
}
|
||||
static fn($value) => $value,
|
||||
fn($value) => $this->filterTools->normalizeFilterString($value)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,13 +44,8 @@ use Symfony\Component\Security\Core\Security;
|
|||
|
||||
class BaseEntityAdminForm extends AbstractType
|
||||
{
|
||||
protected \Symfony\Bundle\SecurityBundle\Security $security;
|
||||
protected EventCommentNeededHelper $eventCommentNeededHelper;
|
||||
|
||||
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, EventCommentNeededHelper $eventCommentNeededHelper)
|
||||
public function __construct(protected \Symfony\Bundle\SecurityBundle\Security $security, protected EventCommentNeededHelper $eventCommentNeededHelper)
|
||||
{
|
||||
$this->security = $security;
|
||||
$this->eventCommentNeededHelper = $eventCommentNeededHelper;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
|
|
@ -82,7 +77,7 @@ class BaseEntityAdminForm extends AbstractType
|
|||
'parent',
|
||||
StructuralEntityType::class,
|
||||
[
|
||||
'class' => get_class($entity),
|
||||
'class' => $entity::class,
|
||||
'required' => false,
|
||||
'label' => 'parent.label',
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
|
||||
|
|
|
|||
|
|
@ -32,12 +32,9 @@ use Symfony\Component\Security\Core\Security;
|
|||
|
||||
class CurrencyAdminForm extends BaseEntityAdminForm
|
||||
{
|
||||
private string $default_currency;
|
||||
|
||||
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, EventCommentNeededHelper $eventCommentNeededHelper, string $default_currency)
|
||||
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, EventCommentNeededHelper $eventCommentNeededHelper, private readonly string $default_currency)
|
||||
{
|
||||
parent::__construct($security, $eventCommentNeededHelper);
|
||||
$this->default_currency = $default_currency;
|
||||
}
|
||||
|
||||
protected function additionalFormElements(FormBuilderInterface $builder, array $options, AbstractNamedDBElement $entity): void
|
||||
|
|
|
|||
|
|
@ -37,11 +37,8 @@ use Symfony\Component\Security\Core\Security;
|
|||
|
||||
class ImportType extends AbstractType
|
||||
{
|
||||
protected \Symfony\Bundle\SecurityBundle\Security $security;
|
||||
|
||||
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security)
|
||||
public function __construct(protected \Symfony\Bundle\SecurityBundle\Security $security)
|
||||
{
|
||||
$this->security = $security;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
|
|
|
|||
|
|
@ -32,11 +32,8 @@ use Symfony\Component\Security\Core\Security;
|
|||
|
||||
class MassCreationForm extends AbstractType
|
||||
{
|
||||
protected \Symfony\Bundle\SecurityBundle\Security $security;
|
||||
|
||||
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security)
|
||||
public function __construct(protected \Symfony\Bundle\SecurityBundle\Security $security)
|
||||
{
|
||||
$this->security = $security;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
|
|
|
|||
|
|
@ -32,12 +32,9 @@ use Symfony\Component\Security\Core\Security;
|
|||
|
||||
class SupplierForm extends CompanyForm
|
||||
{
|
||||
protected string $default_currency;
|
||||
|
||||
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, EventCommentNeededHelper $eventCommentNeededHelper, string $default_currency)
|
||||
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, EventCommentNeededHelper $eventCommentNeededHelper, protected string $default_currency)
|
||||
{
|
||||
parent::__construct($security, $eventCommentNeededHelper);
|
||||
$this->default_currency = $default_currency;
|
||||
}
|
||||
|
||||
protected function additionalFormElements(FormBuilderInterface $builder, array $options, AbstractNamedDBElement $entity): void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue