Passed
Push — master ( 37676a...b0c137 )
by Angel Fernando Quiroz
13:06 queued 02:44
created

ExtAdapter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 14 1
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
declare(strict_types=1);
6
7
namespace Chamilo\CoreBundle\Security\Authenticator\Ldap;
8
9
use Chamilo\CoreBundle\Helpers\AuthenticationConfigHelper;
10
use Symfony\Component\Ldap\Adapter\ExtLdap\Adapter;
11
12
class ExtAdapter extends Adapter
13
{
14
    public function __construct(
15
        private readonly AuthenticationConfigHelper $authConfigHelper,
16
    ) {
17
        $params = $this->authConfigHelper->getLdapConfig(null);
18
19
        $config = [
20
            'connection_string' => $params['connection_string'] ?? 'ldap://localhost:389',
21
            'options' => [
22
                'protocol_version' => $params['protocol_version'] ?? 3,
23
                'referrals' => $params['referrals'] ?? false,
24
            ],
25
        ];
26
27
        parent::__construct($config);
28
    }
29
}
30