NullDatabase   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 1
dl 0
loc 67
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A lastIdCreated() 0 4 1
A create() 0 4 1
A update() 0 4 1
A delete() 0 4 1
A find() 0 4 1
A findAll() 0 4 1
A count() 0 4 1
A has() 0 4 1
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