Completed
Push — master ( 78477d...70d38b )
by Beniamin
03:04
created

ParameterManager   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 21
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createOrGetParameter() 0 8 2
1
<?php
2
3
/**
4
 * This file is part of Phuria SQL Builder package.
5
 *
6
 * Copyright (c) 2016 Beniamin Jonatan Šimko
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Phuria\QueryBuilder;
13
14
/**
15
 * @author Beniamin Jonatan Šimko <[email protected]>
16
 */
17
class ParameterManager
18
{
19
    /**
20
     * @var QueryParameter[] $params
21
     */
22
    private $params = [];
23
24
    /**
25
     * @param string $name
26
     *
27
     * @return QueryParameter
28
     */
29 1
    public function createOrGetParameter($name)
30
    {
31 1
        if (false === array_key_exists($name, $this->params)) {
32 1
            $this->params[$name] = new QueryParameter($name, null);
33 1
        }
34
35 1
        return $this->params[$name];
36
    }
37
}