RawString   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __toString() 0 4 1
1
<?php
2
/*
3
 * This file is part of the Pomm's Foundation package.
4
 *
5
 * (c) 2014 - 2017 Grégoire HUBERT <[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
namespace PommProject\Foundation;
11
12
/**
13
 * RowString
14
 *
15
 * Expression escaper.
16
 *
17
 * This type allows to pass raw expressions as is to the database. Useful to
18
 * call functions or database expressions.
19
 *
20
 * @package   Foundation
21
 * @copyright 2014 - 2017 Grégoire HUBERT
22
 * @author    Grégoire HUBERT
23
 * @license   X11 {@link http://opensource.org/licenses/mit-license.php}
24
 */
25
class RawString
26
{
27
    protected $expression;
28
29
    /**
30
     * __construct
31
     *
32
     * Create a RawString.
33
     *
34
     * @param  string $expression
35
     */
36
    public function __construct($expression)
37
    {
38
        $this->expression = $expression;
39
    }
40
41
    /**
42
     * __toString
43
     *
44
     * String cast this instance.
45
     *
46
     * @return string
47
     */
48
    public function __toString()
49
    {
50
        return $this->expression;
51
    }
52
}
53