diff --git a/src/Form/GroupDeleteConfirm.php b/src/Form/GroupDeleteConfirm.php index 38deff22a1d84dbe615e86fa364299af0677735a..26ddbc45b3e2bf340ba4963447155c2b0a3b3590 100644 --- a/src/Form/GroupDeleteConfirm.php +++ b/src/Form/GroupDeleteConfirm.php @@ -31,7 +31,7 @@ class GroupDeleteConfirm extends FormBase { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface $form_state, BrowserTypeInterface $paragraphs_browser_type = null, $group_machine_name = '') { + public function buildForm(array $form, FormStateInterface $form_state, ?BrowserTypeInterface $paragraphs_browser_type = NULL, $group_machine_name = '') { $this->entity = $paragraphs_browser_type; $form['id'] = array('#type' => 'hidden', '#value' => $group_machine_name); diff --git a/src/Form/GroupEditForm.php b/src/Form/GroupEditForm.php index 5116dcdb5e148c13dc38ac68c4ef4d449d024199..a760199b6d3d0ed1dda298210b026b2f31321fdf 100644 --- a/src/Form/GroupEditForm.php +++ b/src/Form/GroupEditForm.php @@ -37,7 +37,7 @@ class GroupEditForm extends FormBase { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface $form_state, BrowserTypeInterface $paragraphs_browser_type = null, $group_machine_name = '') { + public function buildForm(array $form, FormStateInterface $form_state, ?BrowserTypeInterface $paragraphs_browser_type = NULL, $group_machine_name = '') { /** @var BrowserType $paragraphs_browser_type */ $this->entity = $paragraphs_browser_type; /** @var BrowserGroupList $groups */ diff --git a/src/Form/ParagraphTypeGroupsForm.php b/src/Form/ParagraphTypeGroupsForm.php index 40a4854f9f80dae39257fb144928bc53aa7e3515..5a49301eb103461b42b3b79419e3835ca59e2dd7 100644 --- a/src/Form/ParagraphTypeGroupsForm.php +++ b/src/Form/ParagraphTypeGroupsForm.php @@ -76,7 +76,7 @@ class ParagraphTypeGroupsForm extends FormBase { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface $form_state, ParagraphsTypeInterface $paragraphs_type = null) { + public function buildForm(array $form, FormStateInterface $form_state, ?ParagraphsTypeInterface $paragraphs_type = NULL) { $paragraph_browser_type_ids = $this->entityTypeManager->getStorage('paragraphs_browser_type')->getQuery()->accessCheck(TRUE)->execute(); //@todo: on unsaved change, hide links to configuration forms. if(!$paragraph_browser_type_ids) { diff --git a/src/Form/ParagraphsBrowserForm.php b/src/Form/ParagraphsBrowserForm.php index 7fa0822f9fcd4aad03fd509d08688ed340623ed1..3cf3cd1b1dcd46f14d51517ca27ba998ab616a89 100644 --- a/src/Form/ParagraphsBrowserForm.php +++ b/src/Form/ParagraphsBrowserForm.php @@ -10,16 +10,16 @@ namespace Drupal\paragraphs_browser\Form; use Drupal\Component\Utility\Html; use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\CloseModalDialogCommand; -use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\EntityTypeBundleInfoInterface; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\File\FileUrlGeneratorInterface; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Session\AccountInterface; use Drupal\field\Entity\FieldConfig; use Drupal\paragraphs_browser\Ajax\AddParagraphTypeCommand; use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; -use Drupal\Core\Session\AccountInterface; /** * Class CleanupUrlAliases. @@ -67,18 +67,20 @@ class ParagraphsBrowserForm extends FormBase { protected $fileUrlGenerator; /** - * Constructs a new ParagraphsTypeDeleteConfirm object. + * Constructs a new ParagraphsBrowserForm object. * * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * + * The entity type manager. * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info - * + * The entity type bundle info. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler - * The module handler service. + * The module handler. * @param \Drupal\Core\Session\AccountInterface $current_user * The current user. + * @param \Drupal\Core\File\FileUrlGeneratorInterface|null $file_url_generator + * The file URL generator. */ - public function __construct(EntityTypeManagerInterface $entity_type_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info, ModuleHandlerInterface $module_handler, AccountInterface $current_user, FileUrlGeneratorInterface $file_url_generator = NULL) { + public function __construct(EntityTypeManagerInterface $entity_type_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info, ModuleHandlerInterface $module_handler, AccountInterface $current_user, ?FileUrlGeneratorInterface $file_url_generator = NULL) { $this->entityTypeManager = $entity_type_manager; $this->entityTypeBundleInfo = $entity_type_bundle_info; $this->moduleHandler = $module_handler; @@ -109,7 +111,7 @@ class ParagraphsBrowserForm extends FormBase { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface $form_state, FieldConfig $field_config = null, $paragraphs_browser_type = null, $uuid = null) { + public function buildForm(array $form, FormStateInterface $form_state, ?FieldConfig $field_config = null, $paragraphs_browser_type = null, $uuid = null) { $form_state->addBuildInfo('uuid', $uuid); $form['#attached']['library'][] = 'paragraphs_browser/modal';