Driver_None   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 55
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A transaction() 0 6 1
A exec() 0 7 1
A query() 0 6 1
1
<?php
2
3
/**
4
 * Fallback for database startup errors
5
 *
6
 * PHP Version 5
7
 *
8
 * @category  Core
9
 * @package   Database
10
 * @author    Hans-Joachim Piepereit <[email protected]>
11
 * @copyright 2013 cSphere Team
12
 * @license   http://opensource.org/licenses/bsd-license Simplified BSD License
13
 * @link      http://www.csphere.eu
14
 **/
15
16
namespace csphere\core\database;
17
18
/**
19
 * Fallback for database startup errors
20
 *
21
 * @category  Core
22
 * @package   Database
23
 * @author    Hans-Joachim Piepereit <[email protected]>
24
 * @copyright 2013 cSphere Team
25
 * @license   http://opensource.org/licenses/bsd-license Simplified BSD License
26
 * @link      http://www.csphere.eu
27
 **/
28
29
class Driver_None extends Base
30
{
31
    /**
32
     * Handle database driver specific transactions
33
     *
34
     * @param string $command One of these strings: begin, commit, rollback
35
     *
36
     * @return boolean
37
     **/
0 ignored issues
show
Coding Style introduced by
There must be no blank lines after the function comment
Loading history...
38
39
    public function transaction($command)
40
    {
41
        unset($command);
42
43
        return false;
44
    }
45
46
    /**
47
     * Sends a command to the database and gets the affected rows
48
     *
49
     * @param string  $prepare  Prepared query string with placeholders
50
     * @param array   $assoc    Array with columns and values
51
     * @param boolean $replace  If more than {pre} needs to be replaced
52
     * @param boolean $insertid Return the last insert id instead of a rowcount
53
     * @param boolean $log      Defaults to true which enables log files if used
54
     *
55
     * @return integer
56
     **/
0 ignored issues
show
Coding Style introduced by
There must be no blank lines after the function comment
Loading history...
57
58
    public function exec(
59
        $prepare, array $assoc, $replace = false, $insertid = false, $log = true
60
    ) {
61
        unset($prepare, $assoc, $replace, $insertid, $log);
62
63
        return 0;
64
    }
65
66
    /**
67
     * Sends a query to the database and fetches the result
68
     *
69
     * @param string  $prepare Prepared query string with placeholders
70
     * @param array   $assoc   Array with columns and values
71
     * @param integer $first   Number of the first dataset to show
72
     * @param integer $max     Number of datasets to show from first on
73
     *
74
     * @return array
75
     **/
0 ignored issues
show
Coding Style introduced by
There must be no blank lines after the function comment
Loading history...
76
77
    public function query($prepare, array $assoc, $first = 0, $max = 1)
78
    {
79
        unset($prepare, $assoc, $first, $max);
80
81
        return [];
82
    }
83
}
84