NullDriver   A
last analyzed

Complexity

Total Complexity 18

Size/Duplication

Total Lines 163
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 18
lcom 0
cbo 1
dl 0
loc 163
rs 10
c 0
b 0
f 0

18 Methods

Rating   Name   Duplication   Size   Complexity  
A realPath() 0 4 1
A realExists() 0 4 1
A isRealDir() 0 4 1
A readDir() 0 6 1
A makeDirectory() 0 5 1
A openReadStream() 0 4 1
A readFile() 0 4 1
A getRealMeta() 0 4 1
A ensurePath() 0 4 1
A writeStream() 0 6 1
A writeFile() 0 6 1
A setRealMeta() 0 6 1
A renameDir() 0 6 1
A renameFile() 0 6 1
A copyDir() 0 6 1
A copyFile() 0 6 1
A deleteDir() 0 4 1
A deleteFile() 0 4 1
1
<?php
2
/**
3
 * Phossa Project
4
 *
5
 * PHP version 5.4
6
 *
7
 * @category  Library
8
 * @package   Phossa2\Storage
9
 * @copyright Copyright (c) 2016 phossa.com
10
 * @license   http://mit-license.org/ MIT License
11
 * @link      http://www.phossa.com/
12
 */
13
/*# declare(strict_types=1); */
14
15
namespace Phossa2\Storage\Driver;
16
17
/**
18
 * NullDriver
19
 *
20
 * @package Phossa2\Storage
21
 * @author  Hong Zhang <[email protected]>
22
 * @see     DriverAbstract
23
 * @version 2.0.1
24
 * @since   2.0.0 added
25
 * @since   2.0.1 added makeDirectory()
26
 */
27
class NullDriver extends DriverAbstract
28
{
29
    /**
30
     * {@inheritDoc}
31
     */
32
    protected function realPath(/*# string */ $path)/*# : string */
33
    {
34
        return $path;
35
    }
36
37
    /**
38
     * {@inheritDoc}
39
     */
40
    protected function realExists(/*# string */ $realPath)/*# : bool */
41
    {
42
        return false;
43
    }
44
45
    /**
46
     * {@inheritDoc}
47
     */
48
    protected function isRealDir(/*# string */ $realPath)/*# : bool */
49
    {
50
        return false;
51
    }
52
53
    /**
54
     * {@inheritDoc}
55
     */
56
    protected function readDir(
57
        /*# string */ $realPath,
58
        /*# string */ $prefix = ''
59
    )/*# : array */ {
60
        return [];
61
    }
62
63
    /**
64
     * {@inheritDoc}
65
     */
66
    protected function makeDirectory(
67
        /*# string */ $realPath
68
    )/*# : bool */ {
69
        return true;
70
    }
71
72
    /**
73
     * {@inheritDoc}
74
     */
75
    protected function openReadStream(/*# string */ $realPath)
76
    {
77
        return null;
78
    }
79
80
    /**
81
     * {@inheritDoc}
82
     */
83
    protected function readFile(/*# string */ $realPath)
84
    {
85
        return null;
86
    }
87
88
    /**
89
     * {@inheritDoc}
90
     */
91
    protected function getRealMeta(/*# string */ $realPath)/*# : array */
92
    {
93
        return [];
94
    }
95
96
    /**
97
     * {@inheritDoc}
98
     */
99
    protected function ensurePath(/*# string */ $realPath)/*# : bool */
100
    {
101
        return true;
102
    }
103
104
    /**
105
     * {@inheritDoc}
106
     */
107
    protected function writeStream(
108
        /*# string */ $realPath,
109
        $resource
110
    )/*# : bool */ {
111
        return false;
112
    }
113
114
    /**
115
     * {@inheritDoc}
116
     */
117
    protected function writeFile(
118
        /*# string */ $realPath,
119
        /*# string */ $content
120
    )/*# : bool */ {
121
        return false;
122
    }
123
124
    /**
125
     * {@inheritDoc}
126
     */
127
    protected function setRealMeta(
128
        /*# string */ $realPath,
129
        array $meta
130
    )/*# : bool */ {
131
        return false;
132
    }
133
134
    /**
135
     * {@inheritDoc}
136
     */
137
    protected function renameDir(
138
        /*# string */ $from,
139
        /*# string */ $to
140
    )/*# : bool */ {
141
        return false;
142
    }
143
144
    /**
145
     * {@inheritDoc}
146
     */
147
    protected function renameFile(
148
        /*# string */ $from,
149
        /*# string */ $to
150
    )/*# : bool */ {
151
        return false;
152
    }
153
154
    /**
155
     * {@inheritDoc}
156
     */
157
    protected function copyDir(
158
        /*# string */ $from,
159
        /*# string */ $to
160
    )/*# : bool */ {
161
        return false;
162
    }
163
164
    /**
165
     * {@inheritDoc}
166
     */
167
    protected function copyFile(
168
        /*# string */ $from,
169
        /*# string */ $to
170
    )/*# : bool */ {
171
        return false;
172
    }
173
174
    /**
175
     * {@inheritDoc}
176
     */
177
    protected function deleteDir(/*# string */ $realPath)/*# : bool */
178
    {
179
        return false;
180
    }
181
182
    /**
183
     * {@inheritDoc}
184
     */
185
    protected function deleteFile(/*# string */ $realPath)/*# : bool */
186
    {
187
        return false;
188
    }
189
}
190