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

LdapFactory::getConnection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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