From 29b2451ce900a9123260c7fd916c70a538da99c8 Mon Sep 17 00:00:00 2001
From: xjm <xjm@65776.no-reply.drupal.org>
Date: Sun, 21 Jun 2020 13:55:29 -0500
Subject: [PATCH] =?UTF-8?q?Issue=20#2908079=20by=20jungle,=20voleger,=20mp?=
 =?UTF-8?q?donadio,=20zahord,=20andypost,=20RoSk0,=20Mile23,=20claudiu.cri?=
 =?UTF-8?q?stea,=20alexpott,=20xjm,=20Krzysztof=20Doma=C5=84ski,=20naveenv?=
 =?UTF-8?q?alecha,=20piggito,=20Suresh=20Prabhu=20Parkala,=20daffie,=20daw?=
 =?UTF-8?q?ehner,=20gumanist:=20Move=20some=20of=20the=20bootstrap.inc=20P?=
 =?UTF-8?q?HP-related=20constants=20to=20\Drupal=20and=20deprecate=20the?=
 =?UTF-8?q?=20old=20versions?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 core/includes/bootstrap.inc                   | 35 ++++++++------
 core/includes/install.inc                     |  2 +-
 core/install.php                              | 14 ++++--
 core/lib/Drupal.php                           | 47 +++++++++++++++++++
 .../Core/Extension/ModuleExtensionList.php    |  2 +-
 .../Core/Extension/ProfileExtensionList.php   |  2 +-
 .../Extension/ThemeEngineExtensionList.php    |  2 +-
 .../Core/Extension/ThemeExtensionList.php     |  2 +-
 core/lib/Drupal/Core/Extension/module.api.php |  4 +-
 core/modules/system/system.install            | 24 +++++-----
 .../LibrariesDirectoryFileFinderTest.php      |  4 --
 .../Tests/Core/Command/QuickStartTest.php     |  8 ++--
 ...RequiredByThemesUninstallValidatorTest.php |  4 --
 .../Core/Extension/ThemeExtensionListTest.php |  4 --
 .../Tests/Core/Extension/ThemeHandlerTest.php |  4 --
 .../Drupal/Tests/RequirementsPageTrait.php    |  2 +-
 16 files changed, 101 insertions(+), 59 deletions(-)

diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 1a009fa23246..819a4d9ae29c 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -13,7 +13,7 @@
 use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
 
 /**
- * Minimum allowed version of PHP.
+ * Minimum allowed version of PHP for Drupal to be bootstrapped.
  *
  * Below this version:
  * - The installer cannot be run.
@@ -22,12 +22,13 @@
  * - If a site managed to bypass all of the above, then an error is shown in
  *   the status report and various fatal errors occur on various pages.
  *
- * @see install.php
+ * @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use
+ *   \Drupal::MINIMUM_PHP instead.
  *
- * @todo Move this to an appropriate autoloadable class. See
- *   https://www.drupal.org/project/drupal/issues/2908079
+ * @see https://www.drupal.org/node/2909361
+ * @see install.php
  */
-const DRUPAL_MINIMUM_PHP = '7.3.0';
+const DRUPAL_MINIMUM_PHP = \Drupal::MINIMUM_PHP;
 
 /**
  * Minimum supported version of PHP.
@@ -38,10 +39,12 @@
  *   that Drupal no longer supports that PHP version.
  * - An error is shown in the status report that the PHP version is too old.
  *
- * @todo Move this to an appropriate autoloadable class. See
- *   https://www.drupal.org/project/drupal/issues/2908079
+ * @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use
+ *   \Drupal::MINIMUM_SUPPORTED_PHP instead.
+ *
+ * @see https://www.drupal.org/node/2909361
  */
-const DRUPAL_MINIMUM_SUPPORTED_PHP = '7.3.0';
+const DRUPAL_MINIMUM_SUPPORTED_PHP = \Drupal::MINIMUM_SUPPORTED_PHP;
 
 /**
  * Minimum recommended version of PHP.
@@ -50,10 +53,12 @@
  * message, but Drupal can still be installed. Used for (e.g.) PHP versions
  * that have reached their EOL or will in the near future.
  *
- * @todo Move this to an appropriate autoloadable class. See
- *   https://www.drupal.org/project/drupal/issues/2908079
+ * @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use
+ *   \Drupal::RECOMMENDED_PHP instead.
+ *
+ * @see https://www.drupal.org/node/2909361
  */
-const DRUPAL_RECOMMENDED_PHP = '7.3';
+const DRUPAL_RECOMMENDED_PHP = \Drupal::RECOMMENDED_PHP;
 
 /**
  * Minimum recommended value of PHP memory_limit.
@@ -62,10 +67,12 @@
  * contributed modules to be installed prior to hitting the limit. However,
  * 40M is the target for the Standard installation profile.
  *
- * @todo Move this to an appropriate autoloadable class. See
- *   https://www.drupal.org/project/drupal/issues/2908079
+ * @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use
+ *   \Drupal::MINIMUM_PHP_MEMORY_LIMIT instead.
+ *
+ * @see https://www.drupal.org/node/2909361
  */
-const DRUPAL_MINIMUM_PHP_MEMORY_LIMIT = '64M';
+const DRUPAL_MINIMUM_PHP_MEMORY_LIMIT = \Drupal::MINIMUM_PHP_MEMORY_LIMIT;
 
 /**
  * Error reporting level: display no errors.
diff --git a/core/includes/install.inc b/core/includes/install.inc
index ce7df4759e95..95c9d2b83ab3 100644
--- a/core/includes/install.inc
+++ b/core/includes/install.inc
@@ -1099,7 +1099,7 @@ function install_profile_info($profile, $langcode = 'en') {
       'description' => '',
       'version' => NULL,
       'hidden' => FALSE,
-      'php' => DRUPAL_MINIMUM_PHP,
+      'php' => \Drupal::MINIMUM_PHP,
       'config_install_path' => NULL,
     ];
     $profile_path = drupal_get_path('profile', $profile);
diff --git a/core/install.php b/core/install.php
index 8fae042ed9e5..775ee745c15a 100644
--- a/core/install.php
+++ b/core/install.php
@@ -21,12 +21,16 @@
  */
 define('MAINTENANCE_MODE', 'install');
 
-// Exit early if running an incompatible PHP version to avoid fatal errors.
-// The minimum version is specified explicitly, as DRUPAL_MINIMUM_PHP is not
-// yet available. It is defined in bootstrap.inc, but it is not possible to
-// load that file yet as it would cause a fatal error on older versions of PHP.
+// Exit early if an incompatible PHP version is in use, so that the user sees a
+// helpful error message rather than a whitescreen from any fatal errors due to
+// the incompatible version. The minimum version is also hardcoded (instead of
+// \Drupal::MINIMUM_PHP), to avoid any fatal errors that might result from
+// loading the autoloader or core/lib/Drupal.php. Note: Remember to update the
+// hardcoded minimum PHP version below (both in the version_compare() call and
+// in the printed message to the user) whenever \Drupal::MINIMUM_PHP is
+// updated.
 if (version_compare(PHP_VERSION, '7.3.0') < 0) {
-  print 'Your PHP installation is too old. Drupal requires at least PHP 7.3.0. See the <a href="https://www.drupal.org/requirements">system requirements</a> page for more information.';
+  print 'Your PHP installation is too old. Drupal requires at least PHP 7.3.0. See the <a href="https://www.drupal.org/docs/9/how-drupal-9-is-made-and-what-is-included/environment-requirements-of-drupal-9#s-php-version-requirement">Environment requirements of Drupal 9</a> page for more information.';
   exit;
 }
 
diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php
index 461fda854706..c2fd03d1ee5b 100644
--- a/core/lib/Drupal.php
+++ b/core/lib/Drupal.php
@@ -92,6 +92,53 @@ class Drupal {
    */
   const CORE_MINIMUM_SCHEMA_VERSION = 8000;
 
+  /**
+   * Minimum supported version of PHP.
+   *
+   * Below this version:
+   * - New sites cannot be installed, except from within tests.
+   * - Updates from previous Drupal versions can be run, but users are warned
+   *   that Drupal no longer supports that PHP version.
+   * - An error is shown in the status report that the PHP version is too old.
+   */
+  const MINIMUM_SUPPORTED_PHP = '7.3.0';
+
+  /**
+   * Minimum allowed version of PHP for Drupal to be bootstrapped.
+   *
+   * Below this version:
+   * - The installer cannot be run.
+   * - Updates cannot be run.
+   * - Modules and themes cannot be enabled.
+   * - If a site managed to bypass all of the above, then an error is shown in
+   *   the status report and various fatal errors occur on various pages.
+   *
+   * Note: To prevent the installer from having fatal errors on older versions
+   * of PHP, the value of this constant is hardcoded twice in core/install.php:
+   * - Once as a parameter of version_compare()
+   * - Once in the error message printed to the user immediately after.
+   * Remember to update both whenever this constant is updated.
+   */
+  const MINIMUM_PHP = '7.3.0';
+
+  /**
+   * Minimum recommended value of PHP memory_limit.
+   *
+   * 64M was chosen as a minimum requirement in order to allow for additional
+   * contributed modules to be installed prior to hitting the limit. However,
+   * 40M is the target for the Standard installation profile.
+   */
+  const MINIMUM_PHP_MEMORY_LIMIT = '64M';
+
+  /**
+   * Minimum recommended version of PHP.
+   *
+   * Sites installing Drupal on PHP versions lower than this will see a warning
+   * message, but Drupal can still be installed. Used for (e.g.) PHP versions
+   * that have reached their EOL or will in the near future.
+   */
+  const RECOMMENDED_PHP = '7.3';
+
   /**
    * The currently active container object, or NULL if not initialized yet.
    *
diff --git a/core/lib/Drupal/Core/Extension/ModuleExtensionList.php b/core/lib/Drupal/Core/Extension/ModuleExtensionList.php
index 60b08cc8b549..c05d892b24bf 100644
--- a/core/lib/Drupal/Core/Extension/ModuleExtensionList.php
+++ b/core/lib/Drupal/Core/Extension/ModuleExtensionList.php
@@ -28,7 +28,7 @@ class ModuleExtensionList extends ExtensionList {
     'description' => '',
     'package' => 'Other',
     'version' => NULL,
-    'php' => DRUPAL_MINIMUM_PHP,
+    'php' => \Drupal::MINIMUM_PHP,
   ];
 
   /**
diff --git a/core/lib/Drupal/Core/Extension/ProfileExtensionList.php b/core/lib/Drupal/Core/Extension/ProfileExtensionList.php
index 7c415168d8ad..5ef9c451fdd5 100644
--- a/core/lib/Drupal/Core/Extension/ProfileExtensionList.php
+++ b/core/lib/Drupal/Core/Extension/ProfileExtensionList.php
@@ -22,7 +22,7 @@ class ProfileExtensionList extends ExtensionList {
     'description' => '',
     'package' => 'Other',
     'version' => NULL,
-    'php' => DRUPAL_MINIMUM_PHP,
+    'php' => \Drupal::MINIMUM_PHP,
   ];
 
   /**
diff --git a/core/lib/Drupal/Core/Extension/ThemeEngineExtensionList.php b/core/lib/Drupal/Core/Extension/ThemeEngineExtensionList.php
index c4d39ef6008b..5b9bd692ef74 100644
--- a/core/lib/Drupal/Core/Extension/ThemeEngineExtensionList.php
+++ b/core/lib/Drupal/Core/Extension/ThemeEngineExtensionList.php
@@ -21,7 +21,7 @@ class ThemeEngineExtensionList extends ExtensionList {
     'description' => '',
     'package' => 'Other',
     'version' => NULL,
-    'php' => DRUPAL_MINIMUM_PHP,
+    'php' => \Drupal::MINIMUM_PHP,
   ];
 
   /**
diff --git a/core/lib/Drupal/Core/Extension/ThemeExtensionList.php b/core/lib/Drupal/Core/Extension/ThemeExtensionList.php
index 41ae9310bf4e..c84299abe355 100644
--- a/core/lib/Drupal/Core/Extension/ThemeExtensionList.php
+++ b/core/lib/Drupal/Core/Extension/ThemeExtensionList.php
@@ -48,7 +48,7 @@ class ThemeExtensionList extends ExtensionList {
     ],
     'screenshot' => 'screenshot.png',
     'version' => NULL,
-    'php' => DRUPAL_MINIMUM_PHP,
+    'php' => \Drupal::MINIMUM_PHP,
     'libraries' => [],
     'libraries_extend' => [],
     'libraries_override' => [],
diff --git a/core/lib/Drupal/Core/Extension/module.api.php b/core/lib/Drupal/Core/Extension/module.api.php
index e2ffe1320bf3..1e4f4b12cdaa 100644
--- a/core/lib/Drupal/Core/Extension/module.api.php
+++ b/core/lib/Drupal/Core/Extension/module.api.php
@@ -987,8 +987,8 @@ function hook_requirements($phase) {
     'title' => t('PHP'),
     'value' => ($phase == 'runtime') ? Link::fromTextAndUrl(phpversion(), Url::fromRoute('system.php'))->toString() : phpversion(),
   ];
-  if (version_compare(phpversion(), DRUPAL_MINIMUM_PHP) < 0) {
-    $requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version.', ['%version' => DRUPAL_MINIMUM_PHP]);
+  if (version_compare(phpversion(), \Drupal::MINIMUM_PHP) < 0) {
+    $requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version.', ['%version' => \Drupal::MINIMUM_PHP]);
     $requirements['php']['severity'] = REQUIREMENT_ERROR;
   }
 
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index dc39b9a88cc5..a981accf37a8 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -202,19 +202,19 @@ function system_requirements($phase) {
   }
 
   // Check if the PHP version is below what Drupal supports.
-  if (version_compare($phpversion, DRUPAL_MINIMUM_SUPPORTED_PHP) < 0) {
-    $requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version. It is recommended to upgrade to PHP version %recommended or higher for the best ongoing support. See <a href="http://php.net/supported-versions.php">PHP\'s version support documentation</a> and the <a href=":php_requirements">Drupal 8 PHP requirements handbook page</a> for more information.',
+  if (version_compare($phpversion, \Drupal::MINIMUM_SUPPORTED_PHP) < 0) {
+    $requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version. It is recommended to upgrade to PHP version %recommended or higher for the best ongoing support. See <a href="http://php.net/supported-versions.php">PHP\'s version support documentation</a> and the <a href=":php_requirements">Environment requirements of Drupal 9</a> page for more information.',
       [
-        '%version' => DRUPAL_MINIMUM_SUPPORTED_PHP,
-        '%recommended' => DRUPAL_RECOMMENDED_PHP,
-        ':php_requirements' => 'https://www.drupal.org/docs/8/system-requirements/php',
+        '%version' => \Drupal::MINIMUM_SUPPORTED_PHP,
+        '%recommended' => \Drupal::RECOMMENDED_PHP,
+        ':php_requirements' => 'https://www.drupal.org/docs/9/how-drupal-9-is-made-and-what-is-included/environment-requirements-of-drupal-9#s-php-version-requirement',
       ]
     );
     $requirements['php']['severity'] = REQUIREMENT_ERROR;
 
     // If the PHP version is also below the absolute minimum allowed, it's not
     // safe to continue with the requirements check.
-    if (version_compare($phpversion, DRUPAL_MINIMUM_PHP) < 0) {
+    if (version_compare($phpversion, \Drupal::MINIMUM_PHP) < 0) {
       return $requirements;
     }
     // Otherwise downgrade the error to a warning during updates. Even if there
@@ -235,8 +235,8 @@ function system_requirements($phase) {
   // For PHP versions that are still supported but no longer recommended,
   // inform users of what's recommended, allowing them to take action before it
   // becomes urgent.
-  elseif ($phase === 'runtime' && version_compare($phpversion, DRUPAL_RECOMMENDED_PHP) < 0) {
-    $requirements['php']['description'] = t('It is recommended to upgrade to PHP version %recommended or higher for the best ongoing support.  See <a href="http://php.net/supported-versions.php">PHP\'s version support documentation</a> and the <a href=":php_requirements">Drupal 8 PHP requirements handbook page</a> for more information.', ['%recommended' => DRUPAL_RECOMMENDED_PHP, ':php_requirements' => 'https://www.drupal.org/docs/8/system-requirements/php']);
+  elseif ($phase === 'runtime' && version_compare($phpversion, \Drupal::RECOMMENDED_PHP) < 0) {
+    $requirements['php']['description'] = t('It is recommended to upgrade to PHP version %recommended or higher for the best ongoing support.  See <a href="http://php.net/supported-versions.php">PHP\'s version support documentation</a> and the <a href=":php_requirements">Drupal 8 PHP requirements handbook page</a> for more information.', ['%recommended' => \Drupal::RECOMMENDED_PHP, ':php_requirements' => 'https://www.drupal.org/docs/8/system-requirements/php']);
     $requirements['php']['severity'] = REQUIREMENT_INFO;
   }
 
@@ -463,16 +463,16 @@ function system_requirements($phase) {
     'value' => $memory_limit == -1 ? t('-1 (Unlimited)') : $memory_limit,
   ];
 
-  if (!Environment::checkMemoryLimit(DRUPAL_MINIMUM_PHP_MEMORY_LIMIT, $memory_limit)) {
+  if (!Environment::checkMemoryLimit(\Drupal::MINIMUM_PHP_MEMORY_LIMIT, $memory_limit)) {
     $description = [];
     if ($phase == 'install') {
-      $description['phase'] = t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the installation process.', ['%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT]);
+      $description['phase'] = t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the installation process.', ['%memory_minimum_limit' => \Drupal::MINIMUM_PHP_MEMORY_LIMIT]);
     }
     elseif ($phase == 'update') {
-      $description['phase'] = t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the update process.', ['%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT]);
+      $description['phase'] = t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the update process.', ['%memory_minimum_limit' => \Drupal::MINIMUM_PHP_MEMORY_LIMIT]);
     }
     elseif ($phase == 'runtime') {
-      $description['phase'] = t('Depending on your configuration, Drupal can run with a %memory_limit PHP memory limit. However, a %memory_minimum_limit PHP memory limit or above is recommended, especially if your site uses additional custom or contributed modules.', ['%memory_limit' => $memory_limit, '%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT]);
+      $description['phase'] = t('Depending on your configuration, Drupal can run with a %memory_limit PHP memory limit. However, a %memory_minimum_limit PHP memory limit or above is recommended, especially if your site uses additional custom or contributed modules.', ['%memory_limit' => $memory_limit, '%memory_minimum_limit' => \Drupal::MINIMUM_PHP_MEMORY_LIMIT]);
     }
 
     if (!empty($description['phase'])) {
diff --git a/core/tests/Drupal/Tests/Core/Asset/LibrariesDirectoryFileFinderTest.php b/core/tests/Drupal/Tests/Core/Asset/LibrariesDirectoryFileFinderTest.php
index a347200ad814..dab1ef3db07c 100644
--- a/core/tests/Drupal/Tests/Core/Asset/LibrariesDirectoryFileFinderTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/LibrariesDirectoryFileFinderTest.php
@@ -82,7 +82,3 @@ public function testFind() {
   }
 
 }
-
-if (!defined('DRUPAL_MINIMUM_PHP')) {
-  define('DRUPAL_MINIMUM_PHP', '7.0.8');
-}
diff --git a/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php b/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php
index 12a0d88e1c76..594f29eabc06 100644
--- a/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php
+++ b/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php
@@ -86,7 +86,7 @@ public function tearDown(): void {
    * Tests the quick-start command.
    */
   public function testQuickStartCommand() {
-    if (version_compare(phpversion(), DRUPAL_MINIMUM_SUPPORTED_PHP) < 0) {
+    if (version_compare(phpversion(), \Drupal::MINIMUM_SUPPORTED_PHP) < 0) {
       $this->markTestSkipped();
     }
     if (version_compare(\SQLite3::version()['versionString'], Tasks::SQLITE_MINIMUM_VERSION) < 0) {
@@ -144,7 +144,7 @@ public function testQuickStartCommand() {
    * Tests that the installer throws a requirement error on older PHP versions.
    */
   public function testPhpRequirement() {
-    if (version_compare(phpversion(), DRUPAL_MINIMUM_SUPPORTED_PHP) >= 0) {
+    if (version_compare(phpversion(), \Drupal::MINIMUM_SUPPORTED_PHP) >= 0) {
       $this->markTestSkipped();
     }
 
@@ -167,7 +167,7 @@ public function testPhpRequirement() {
     $error_output = $process->getErrorOutput();
     $this->assertStringContainsString('Your PHP installation is too old.', $error_output);
     $this->assertStringContainsString('Drupal requires at least PHP', $error_output);
-    $this->assertStringContainsString(DRUPAL_MINIMUM_SUPPORTED_PHP, $error_output);
+    $this->assertStringContainsString(\Drupal::MINIMUM_SUPPORTED_PHP, $error_output);
 
     // Stop the web server.
     $process->stop();
@@ -177,7 +177,7 @@ public function testPhpRequirement() {
    * Tests the quick-start commands.
    */
   public function testQuickStartInstallAndServerCommands() {
-    if (version_compare(phpversion(), DRUPAL_MINIMUM_SUPPORTED_PHP) < 0) {
+    if (version_compare(phpversion(), \Drupal::MINIMUM_SUPPORTED_PHP) < 0) {
       $this->markTestSkipped();
     }
     if (version_compare(\SQLite3::version()['versionString'], Tasks::SQLITE_MINIMUM_VERSION) < 0) {
diff --git a/core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php b/core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php
index 254bde86d66c..3c2eb03d5286 100644
--- a/core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php
@@ -155,7 +155,3 @@ public function testValidateTwoThemeDependencies() {
   }
 
 }
-
-if (!defined('DRUPAL_MINIMUM_PHP')) {
-  define('DRUPAL_MINIMUM_PHP', '7.3.0');
-}
diff --git a/core/tests/Drupal/Tests/Core/Extension/ThemeExtensionListTest.php b/core/tests/Drupal/Tests/Core/Extension/ThemeExtensionListTest.php
index a4085b0f8ea7..835dc94b5960 100644
--- a/core/tests/Drupal/Tests/Core/Extension/ThemeExtensionListTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ThemeExtensionListTest.php
@@ -259,7 +259,3 @@ class TestThemeEngineExtensionList extends ThemeEngineExtensionList {
   use SettableDiscoveryExtensionListTrait;
 
 }
-
-if (!defined('DRUPAL_MINIMUM_PHP')) {
-  define('DRUPAL_MINIMUM_PHP', '7.3.0');
-}
diff --git a/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php b/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
index b68765a8771b..fe2ca19033a9 100644
--- a/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
@@ -145,7 +145,3 @@ protected function themeRegistryRebuild() {
   }
 
 }
-
-if (!defined('DRUPAL_MINIMUM_PHP')) {
-  define('DRUPAL_MINIMUM_PHP', '7.3.0');
-}
diff --git a/core/tests/Drupal/Tests/RequirementsPageTrait.php b/core/tests/Drupal/Tests/RequirementsPageTrait.php
index b71afba0841c..0c2cc2a11455 100644
--- a/core/tests/Drupal/Tests/RequirementsPageTrait.php
+++ b/core/tests/Drupal/Tests/RequirementsPageTrait.php
@@ -13,7 +13,7 @@ trait RequirementsPageTrait {
   protected function updateRequirementsProblem() {
     // Assert a warning is shown on older test environments.
     $links = $this->getSession()->getPage()->findAll('named', ['link', 'try again']);
-    if ($links && version_compare(phpversion(), DRUPAL_MINIMUM_SUPPORTED_PHP) < 0) {
+    if ($links && version_compare(phpversion(), \Drupal::MINIMUM_SUPPORTED_PHP) < 0) {
       $this->assertNoText('Errors found');
       $this->assertWarningSummaries(['PHP']);
       $this->clickLink('try again');
-- 
GitLab