RawString::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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