Completed
Push — master ( 77e4e4...2e1347 )
by Beniamin
05:23
created

QueryParameter   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 4 1
A setValue() 0 6 1
A getName() 0 4 1
A getValue() 0 4 1
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\Parameter;
13
14
/**
15
 * @author Beniamin Jonatan Šimko <[email protected]>
16
 */
17
class QueryParameter
18
{
19
    /**
20
     * @var $name
21
     */
22
    private $name;
23
24
    /**
25
     * @var $value
26
     */
27
    private $value;
28
29
    /**
30
     * @param string $name
31
     * @param mixed  $value
32
     */
33 2
    public function __construct($name, $value)
34
    {
35 2
        $this->name = $name;
36 2
        $this->value = $value;
37 2
    }
38
39
    /**
40
     * @return string
41
     */
42 2
    public function __toString()
43
    {
44 2
        return sprintf(':%s', $this->name);
45
    }
46
47
    /**
48
     * @param mixed $value
49
     *
50
     * @return $this
51
     */
52 1
    public function setValue($value)
53
    {
54 1
        $this->value = $value;
55
56 1
        return $this;
57
    }
58
59
    /**
60
     * @return mixed
61
     */
62 1
    public function getName()
63
    {
64 1
        return $this->name;
65
    }
66
67
    /**
68
     * @return mixed
69
     */
70 1
    public function getValue()
71
    {
72 1
        return $this->value;
73
    }
74
}