SQLDetector   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A readonly() 0 6 2
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