By daffie on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
9.5.x
Introduced in version:
9.5.0
Issue links:
Description:
New public method \Drupal::getMajorVersion() was added that returns Drupal's major version as a string.
$version = \Drupal::getMajorVersion();
// The value of $version is '9' or '10'.
Impacts:
Module developers