Completed
Push — master ( 3152a4...36e9e8 )
by Hong
02:25
created

Raw::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
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\RawInterface;
18
use Phossa2\Query\Traits\StatementAbstract;
19
use Phossa2\Query\Interfaces\BuilderInterface;
20
21
/**
22
 * Raw
23
 *
24
 * @package Phossa2\Query
25
 * @author  Hong Zhang <[email protected]>
26
 * @see     StatementAbstract
27
 * @see     RawInterface
28
 * @version 2.0.0
29
 * @since   2.0.0 added
30
 */
31
class Raw extends StatementAbstract implements RawInterface
32
{
33
    /**
34
     * raw string
35
     *
36
     * @var    string
37
     * @access protected
38
     */
39
    protected $raw_string;
40
41
    /**
42
     * Constructor
43
     *
44
     * @param  string $rawSql
45
     * @param  BuilderInterface $builder
46
     * @access public
47
     */
48
    public function __construct(
49
        /*# string */ $rawSql,
50
        BuilderInterface $builder
51
    ) {
52
        parent::__construct($builder);
53
        $this->raw_string = (string) $rawSql;
54
    }
55
56
    /**
57
     * {@inheritDoc}
58
     */
59
    protected function buildSql(array $settings)/*# : string */
60
    {
61
        return $this->raw_string;
62
    }
63
}
64