NullDatabase::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 3
crap 2
1
<?php
2
namespace DAL;
3
4
use \Exception;
5
use \mysqli;
6
use \mysqli_result;
7
use \DAL\Exceptions\DatabaseException;
8
9
class NullDatabase extends AbstractDatabase
10
{
11
12
    /**
13
     * @return mixed
14
     */
15
    public function lastIdCreated()
16
    {
17
        return null;
18
    }
19
20
    /**
21
     * @return void
22
     */
23
    public function create($table, array $fields, array $options = [])
24
    {
25
        /* Noop */
26
    }
27
28
    /**
29
     * @return void
30
     */
31
    public function update($table, array $fields, Condition $criteria = null, array $options = [])
32
    {
33
        /* Noop */
34
    }
35
36
    /**
37
     * @return void
38
     */
39
    public function delete($table, Condition $criteria = null, array $options = [])
40
    {
41
        /* Noop */
42
    }
43
44
    /**
45
     * @return null
46
     */
47
    public function find($table, Condition $criteria = null, array $options = [])
48
    {
49
        return null;
50
    }
51
52
    /**
53
     * @return array
54
     */
55
    public function findAll($table, Condition $criteria = null, array $options = [])
56
    {
57
        return [];
58
    }
59
60
    /**
61
     * @return int
62
     */
63
    public function count($table, Condition $criteria = null, array $options = [])
64
    {
65
        return 0;
66
    }
67
68
    /**
69
     * @return boolean
70
     */
71
    public function has($table, Condition $criteria = null, array $options = [])
72
    {
73
        return false;
74
    }
75
}
76