Raw::__construct()   A
last analyzed

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
 * Phossa Project
4
 *
5
 * PHP version 5.4
6
 *
7
 * @category  Library
8
 * @package   Phossa2\Query
9
 * @copyright Copyright (c) 2016 phossa.com
10
 * @license   http://mit-license.org/ MIT License
11
 * @link      http://www.phossa.com/
12
 */
13
/*# declare(strict_types=1); */
14
15
namespace Phossa2\Query\Misc;
16
17
use Phossa2\Query\Interfaces\OutputInterface;
18
19
/**
20
 * Raw string object
21
 *
22
 * @package Phossa2\Query
23
 * @author  Hong Zhang <[email protected]>
24
 * @see     OutputInterface
25
 * @version 2.0.0
26
 * @since   2.0.0 added
27
 */
28
class Raw implements OutputInterface
29
{
30
    /**
31
     * raw string
32
     *
33
     * @var    string
34
     * @access protected
35
     */
36
    protected $raw_string;
37
38
    /**
39
     * Constructor
40
     *
41
     * @param  string $rawSql
42
     * @access public
43
     */
44
    public function __construct(/*# string */ $rawSql)
45
    {
46
        $this->raw_string = (string) $rawSql;
47
    }
48
49
    /**
50
     * {@inheritDoc}
51
     */
52
    public function getStatement(array $settings = [])/*# : string */
53
    {
54
        return $this->raw_string;
55
    }
56
57
    /**
58
     * {@inheritDoc}
59
     */
60
    public function __toString()/*# : string */
61
    {
62
        return $this->getStatement();
63
    }
64
}
65