From 1fbd03fe9a66ff888aa89d60151b669374d8d692 Mon Sep 17 00:00:00 2001
From: Patrizio Bekerle <patrizio@bekerle.com>
Date: Thu, 18 Nov 2021 13:33:10 +0100
Subject: [PATCH] Remove unused $params parameter and allow more birthday
 formats

---
 src/Service/LDAPApi.php | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/Service/LDAPApi.php b/src/Service/LDAPApi.php
index 8caed5a..37c049d 100644
--- a/src/Service/LDAPApi.php
+++ b/src/Service/LDAPApi.php
@@ -58,8 +58,6 @@ class LDAPApi implements LoggerAwareInterface, ServiceSubscriberInterface
 
     private $locator;
 
-    private $params;
-
     private $identifierAttributeName;
 
     private $givenNameAttributeName;
@@ -72,12 +70,11 @@ class LDAPApi implements LoggerAwareInterface, ServiceSubscriberInterface
 
     private $ldapApiProvider;
 
-    public function __construct(ContainerInterface $locator, ParameterBagInterface $params, LDAPApiProviderInterface $ldapApiProvider)
+    public function __construct(ContainerInterface $locator, LDAPApiProviderInterface $ldapApiProvider)
     {
         $this->ad = new Adldap();
         $this->cacheTTL = 0;
         $this->currentPerson = null;
-        $this->params = $params;
         $this->ldapApiProvider = $ldapApiProvider;
         $this->locator = $locator;
         $this->deploymentEnv = 'production';
@@ -259,7 +256,7 @@ class LDAPApi implements LoggerAwareInterface, ServiceSubscriberInterface
         if ($birthDateString !== '') {
             $matches = [];
 
-            if (preg_match('/^(\d{4})-(\d{2})-(\d{2})$/', $birthDateString, $matches)) {
+            if (preg_match('/^(\d{4})-(\d{2})-(\d{2})/', $birthDateString, $matches)) {
                 $person->setBirthDate("{$matches[1]}-{$matches[2]}-{$matches[3]}");
             }
         }
-- 
GitLab