Skip to content
Snippets Groups Projects

Resolve #3413732 "Deprecated function creation"

2 files
+ 20
5
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -3,12 +3,12 @@
namespace Drupal\open_readspeaker\Plugin\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Link;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Url;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Symfony\Component\HttpFoundation\Request;
/**
@@ -28,6 +28,13 @@ class OpenReadspeakerBlock extends BlockBase implements ContainerFactoryPluginIn
*/
protected $configFactory;
/**
* The current request.
*
* @var \Symfony\Component\HttpFoundation\Request
*/
protected $request;
/**
* Constructs a Drupal\Component\Plugin\PluginBase object.
*
@@ -47,7 +54,8 @@ class OpenReadspeakerBlock extends BlockBase implements ContainerFactoryPluginIn
$plugin_id,
$plugin_definition,
ConfigFactoryInterface $config_factory,
Request $request) {
Request $request,
) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->configFactory = $config_factory;
$this->request = $request;
@@ -62,7 +70,7 @@ class OpenReadspeakerBlock extends BlockBase implements ContainerFactoryPluginIn
$plugin_id,
$plugin_definition,
$container->get('config.factory'),
$container->get('request_stack')->getCurrentRequest()
$container->get('request_stack')->getCurrentRequest(),
);
}
Loading