From 45447b2f90e747ac6161fa07e2a834992e8c303d Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Fri, 19 Jun 2020 13:59:09 +0100
Subject: [PATCH] Issue #3135305 by longwave: Remove Symfony 4.1 compatibility
 layer from EmailConstraint

---
 .../Validation/Constraint/EmailConstraint.php      | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php
index 0a2b2d5946cc..d269b70ea1e5 100644
--- a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php
+++ b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php
@@ -20,19 +20,7 @@ class EmailConstraint extends Email {
    * {@inheritdoc}
    */
   public function __construct($options = []) {
-    // Since Symfony 4.1, the 'mode' property is used, for previous versions the
-    // 'strict' property. If the 'strict' property is set,
-    // \Symfony\Component\Validator\Constraints\EmailValidator will trigger
-    // a deprecation error, so only assign a value for versions of Symfony
-    // < 4.2. This compatibility layer can be removed once Drupal requires
-    // Symfony 4.2 or higher in https://www.drupal.org/node/3009219.
-    if (property_exists($this, 'mode')) {
-      $default_options = ['mode' => 'strict'];
-    }
-    else {
-      $default_options = ['strict' => TRUE];
-    }
-    $options += $default_options;
+    $options += ['mode' => 'strict'];
     parent::__construct($options);
   }
 
-- 
GitLab