Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293443

[PP-1] Deprecate TimeInterface::getCurrentTime() and replace with ClockInterface::now()->getTimestamp()

$
0
0

Problem/Motivation

Follow up to #3501375: Implement PSR-20 in datetime.time service where we added a new \Psr\ClockInterface service we can inject.

We should switch from using \Drupal\Component\Datetime\TimeInterface::getCurrentTime() and instead use the PSR-20 \Psr\ClockInterface::now()->getTimestamp() for PHP interoperability.

We can also add a \Drupal::clock() method to help with non-dependency injected code.

Steps to reproduce

Proposed resolution

  • Deprecate \Drupal\Component\Datetime\TimeInterface::getCurrentTime()
  • Add a code>\Drupal::clock() method
  • Replace instances of \Drupal\Component\Datetime\TimeInterface::getCurrentTime() with \Psr\ClockInterface::now()->getTimestamp()

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 293443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>