Completed
Push — master ( fb3d48...947961 )
by Chad
02:22
created

LdapFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfig() 0 4 1
A getConnection() 0 4 1
1
<?php
2
/**
3
 * This file is part of the LdapToolsBundle package.
4
 *
5
 * (c) Chad Sikorra <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace LdapTools\Bundle\LdapToolsBundle\Factory;
12
13
use LdapTools\Connection\LdapConnection;
14
use LdapTools\DomainConfiguration;
15
16
/**
17
 * Used to assist in making components needing active connections more spec/test'able.
18
 *
19
 * @author Chad Sikorra <[email protected]>
20
 */
21
class LdapFactory
22
{
23
    /**
24
     * @param string $domain
25
     * @return DomainConfiguration
26
     */
27
    public function getConfig($domain)
28
    {
29
        return new DomainConfiguration($domain);
30
    }
31
32
    /**
33
     * @param DomainConfiguration $config
34
     * @return LdapConnection
35
     */
36
    public function getConnection(DomainConfiguration $config)
37
    {
38
        return new LdapConnection($config);
39
    }
40
}
41