Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / node / src / Form / NodeRevisionRevertForm.php
index 9702d35374ac32d921dcc745ebb61a765543d52d..8137c3f4fa1d7a4eb1733680ecfa27e1ca772652 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace Drupal\node\Form;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Datetime\DateFormatterInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Form\ConfirmFormBase;
@@ -50,11 +51,13 @@ class NodeRevisionRevertForm extends ConfirmFormBase {
    *   The node storage.
    * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter
    *   The date formatter service.
+   * @param \Drupal\Component\Datetime\TimeInterface $time
+   *   The time service.
    */
-  public function __construct(EntityStorageInterface $node_storage, DateFormatterInterface $date_formatter) {
+  public function __construct(EntityStorageInterface $node_storage, DateFormatterInterface $date_formatter, TimeInterface $time) {
     $this->nodeStorage = $node_storage;
     $this->dateFormatter = $date_formatter;
-    $this->time = \Drupal::service('datetime.time');
+    $this->time = $time;
   }
 
   /**
@@ -63,7 +66,8 @@ class NodeRevisionRevertForm extends ConfirmFormBase {
   public static function create(ContainerInterface $container) {
     return new static(
       $container->get('entity.manager')->getStorage('node'),
-      $container->get('date.formatter')
+      $container->get('date.formatter'),
+      $container->get('datetime.time')
     );
   }