X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fnode%2Fsrc%2FForm%2FNodeRevisionRevertForm.php;h=8137c3f4fa1d7a4eb1733680ecfa27e1ca772652;hp=9702d35374ac32d921dcc745ebb61a765543d52d;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/node/src/Form/NodeRevisionRevertForm.php b/web/core/modules/node/src/Form/NodeRevisionRevertForm.php index 9702d3537..8137c3f4f 100644 --- a/web/core/modules/node/src/Form/NodeRevisionRevertForm.php +++ b/web/core/modules/node/src/Form/NodeRevisionRevertForm.php @@ -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') ); }