diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 9a2b1aa..6025473 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -772,9 +772,10 @@ function drupal_classloader_register($name, $path) { * @see drupal_static_reset() * @see \Drupal\Component\Utility\StaticStorage * - * @deprecated in Drupal 8.1.x, will be removed before Drupal 9.0.0. Do not use - * global static PHP variables. For globally-accessible in-memory caching, use - * services. + * @deprecated in Drupal 8.2.x, will be removed before Drupal 9.0.0. Do not use + * static PHP variables. If in-memory caching is required, use + * \Drupal\Component\Utility\StaticStorage, or a non-static property on a + * long-lived object such as a service. */ function &drupal_static($name, $default_value = NULL) { $value = &StaticStorage::get($name, $default_value); @@ -787,8 +788,9 @@ function &drupal_static($name, $default_value = NULL) { * @param $name * Name of the static variable to reset. Omit to reset all variables. * - * @deprecated in Drupal 8.1.x, will be removed before Drupal 9.0.0. Do not use - * global PHP statics. Tests can use + * @deprecated in Drupal 8.2.x, will be removed before Drupal 9.0.0. Do not use + * statics. drupal_static() uses \Drupal\Component\Utility\StaticStorage as a + * back-end, so tests can use * \Drupal\Component\Utility\StaticStorage::reset() or * \Drupal\Component\Utility\StaticStorage::resetAll() in order to manage the * static cache for legacy code. diff --git a/core/lib/Drupal/Component/Utility/StaticStorage.php b/core/lib/Drupal/Component/Utility/StaticStorage.php index 1648378..17bd1a9 100644 --- a/core/lib/Drupal/Component/Utility/StaticStorage.php +++ b/core/lib/Drupal/Component/Utility/StaticStorage.php @@ -105,10 +105,6 @@ * ... * } * @endcode - * - * @deprecated in Drupal 8.1.x, will be removed before Drupal 9.0.0. Do not use - * global static PHP variables. For globally-accessible in-memory caching, use - * services. */ class StaticStorage {