- Issue created by @tobiasb
- @tobiasb opened merge request.
When you call \Drupal::service('date.formatter')->format($timestamp, $type = '', $format = 'd.d.d.d')
Drupal tries to load the date format based on the type because it is not custom
but will not found any format for empty string. This can lead to unnecessary calls.
See profiler images before/after in
🐛
Set missing datetime type
Active
.
Teach people via phpdoc non-empty-string (phpstan) and set internal the type to custom when format is provided or medium, when not.
-
-
-
-
-
-
Active
11.0 🔥
datetime.module
It affects performance. It is often combined with the Needs profiling tag.