SQLDetector::readonly()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * SQL detector
4
 * User: moyo
5
 * Date: 02/11/2017
6
 * Time: 6:03 PM
7
 */
8
9
namespace Carno\Database\Chips;
10
11
trait SQLDetector
12
{
13
    /**
14
     * @param string $sql
15
     * @return bool
16
     */
17
    protected function readonly(string $sql) : bool
18
    {
19
        if (strtolower(substr($sql, 0, 7)) === 'select ') {
20
            return true;
21
        } else {
22
            return false;
23
        }
24
    }
25
}
26