Loading modules/invite_link/src/Plugin/Block/InviteLinkBlock.php +1 −27 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ namespace Drupal\invite_link\Plugin\Block; use Drupal\Core\Block\BlockBase; use Drupal\invite_link\Form\InviteLinkBlockForm; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides an 'InviteLinkBlock' block. Loading @@ -20,35 +19,10 @@ class InviteLinkBlock extends BlockBase { /** * {@inheritdoc} */ /** * FormBuilder. * */ protected $formBuilder; /** * Constructor. */ public function __construct($formBuilder) { $this->formBuilder = $formBuilder; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( $container->get('form_builder') ); } /** * Build method. */ public function build() { $block_id = $this->getDerivativeId(); $build = []; $form = $this->formBuilder->getForm(new InviteLinkBlockForm(), $block_id); $form = \Drupal::formBuilder()->getForm(new InviteLinkBlockForm(), $block_id); $build['form'] = $form; return $build; Loading src/Form/InviteTypeForm.php +2 −10 Original line number Diff line number Diff line Loading @@ -11,7 +11,6 @@ use Drupal\invite\Entity\InviteSender; use Drupal\invite\InvitePluginManager; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Config\ConfigFactory; /** * Form controller for Invite type edit forms. Loading Loading @@ -49,12 +48,6 @@ class InviteTypeForm extends EntityForm { */ protected $messenger; /** * {@inheritdoc} */ protected $configFactory; /** * {@inheritdoc} */ Loading @@ -70,12 +63,11 @@ class InviteTypeForm extends EntityForm { /** * {@inheritdoc} */ public function __construct(InvitePluginManager $plugin_manager, BlockManager $block_plugin_manager, Connection $database, MessengerInterface $messenger, ConfigFactory $configFactory) { public function __construct(InvitePluginManager $plugin_manager, BlockManager $block_plugin_manager, Connection $database, MessengerInterface $messenger) { $this->pluginManager = $plugin_manager; $this->database = $database; $this->blockManager = $block_plugin_manager; $this->messenger = $messenger; $this->configFactory = $configFactory; } /** Loading @@ -83,7 +75,7 @@ class InviteTypeForm extends EntityForm { */ public function getDefaultSendMethods($invite_type) { $defaults = []; foreach (explode('||', $this->configFactory->get('invite.invite_sender.' . $invite_type->getType())->get('sending_methods')) as $sending_method) { foreach (explode('||', \Drupal::config('invite.invite_sender.' . $invite_type->getType())->get('sending_methods')) as $sending_method) { if ($sending_method != '0') { $defaults[$sending_method] = $sending_method; } Loading Loading
modules/invite_link/src/Plugin/Block/InviteLinkBlock.php +1 −27 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ namespace Drupal\invite_link\Plugin\Block; use Drupal\Core\Block\BlockBase; use Drupal\invite_link\Form\InviteLinkBlockForm; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides an 'InviteLinkBlock' block. Loading @@ -20,35 +19,10 @@ class InviteLinkBlock extends BlockBase { /** * {@inheritdoc} */ /** * FormBuilder. * */ protected $formBuilder; /** * Constructor. */ public function __construct($formBuilder) { $this->formBuilder = $formBuilder; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( $container->get('form_builder') ); } /** * Build method. */ public function build() { $block_id = $this->getDerivativeId(); $build = []; $form = $this->formBuilder->getForm(new InviteLinkBlockForm(), $block_id); $form = \Drupal::formBuilder()->getForm(new InviteLinkBlockForm(), $block_id); $build['form'] = $form; return $build; Loading
src/Form/InviteTypeForm.php +2 −10 Original line number Diff line number Diff line Loading @@ -11,7 +11,6 @@ use Drupal\invite\Entity\InviteSender; use Drupal\invite\InvitePluginManager; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Config\ConfigFactory; /** * Form controller for Invite type edit forms. Loading Loading @@ -49,12 +48,6 @@ class InviteTypeForm extends EntityForm { */ protected $messenger; /** * {@inheritdoc} */ protected $configFactory; /** * {@inheritdoc} */ Loading @@ -70,12 +63,11 @@ class InviteTypeForm extends EntityForm { /** * {@inheritdoc} */ public function __construct(InvitePluginManager $plugin_manager, BlockManager $block_plugin_manager, Connection $database, MessengerInterface $messenger, ConfigFactory $configFactory) { public function __construct(InvitePluginManager $plugin_manager, BlockManager $block_plugin_manager, Connection $database, MessengerInterface $messenger) { $this->pluginManager = $plugin_manager; $this->database = $database; $this->blockManager = $block_plugin_manager; $this->messenger = $messenger; $this->configFactory = $configFactory; } /** Loading @@ -83,7 +75,7 @@ class InviteTypeForm extends EntityForm { */ public function getDefaultSendMethods($invite_type) { $defaults = []; foreach (explode('||', $this->configFactory->get('invite.invite_sender.' . $invite_type->getType())->get('sending_methods')) as $sending_method) { foreach (explode('||', \Drupal::config('invite.invite_sender.' . $invite_type->getType())->get('sending_methods')) as $sending_method) { if ($sending_method != '0') { $defaults[$sending_method] = $sending_method; } Loading