Completed
Push — master ( 9ef354...ebcd99 )
by Hong
02:10
created

NullDriver::writeStream()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
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.0
24
 * @since   2.0.0 added
25
 */
26
class NullDriver extends DriverAbstract
27
{
28
    /**
29
     * {@inheritDoc}
30
     */
31
    protected function realPath(/*# string */ $path)/*# : string */
32
    {
33
        return $path;
34
    }
35
36
    /**
37
     * {@inheritDoc}
38
     */
39
    protected function realExists(/*# string */ $realPath)/*# : bool */
40
    {
41
        return false;
42
    }
43
44
    /**
45
     * {@inheritDoc}
46
     */
47
    protected function isDir(/*# string */ $realPath)/*# : bool */
48
    {
49
        return false;
50
    }
51
52
    /**
53
     * {@inheritDoc}
54
     */
55
    protected function readDir(
56
        /*# string */ $realPath,
57
        /*# string */ $prefix = ''
58
    )/*# : array */ {
59
        return [];
60
    }
61
62
    /**
63
     * {@inheritDoc}
64
     */
65
    protected function openReadStream(/*# string */ $realPath)
66
    {
67
        return null;
68
    }
69
70
    /**
71
     * {@inheritDoc}
72
     */
73
    protected function readFile(/*# string */ $realPath)
74
    {
75
        return null;
76
    }
77
78
    /**
79
     * {@inheritDoc}
80
     */
81
    protected function getRealMeta(/*# string */ $realPath)/*# : array */
82
    {
83
        return [];
84
    }
85
86
    /**
87
     * {@inheritDoc}
88
     */
89
    protected function ensurePath(/*# string */ $realPath)/*# : bool */
90
    {
91
        return true;
92
    }
93
94
    /**
95
     * {@inheritDoc}
96
     */
97
    protected function writeStream(
98
        /*# string */ $realPath,
99
        $resource
100
    )/*# : bool */ {
101
        return false;
102
    }
103
104
    /**
105
     * {@inheritDoc}
106
     */
107
    protected function writeFile(
108
        /*# string */ $realPath,
109
        /*# string */ $content
110
    )/*# : bool */ {
111
        return false;
112
    }
113
114
    /**
115
     * {@inheritDoc}
116
     */
117
    protected function setRealMeta(
118
        /*# string */ $realPath,
119
        array $meta
120
    )/*# : bool */ {
121
        return false;
122
    }
123
124
    /**
125
     * {@inheritDoc}
126
     */
127
    protected function renameDir(
128
        /*# string */ $from,
129
        /*# string */ $to
130
    )/*# : bool */ {
131
        return false;
132
    }
133
134
    /**
135
     * {@inheritDoc}
136
     */
137
    protected function renameFile(
138
        /*# string */ $from,
139
        /*# string */ $to
140
    )/*# : bool */ {
141
        return false;
142
    }
143
144
    /**
145
     * {@inheritDoc}
146
     */
147
    protected function copyDir(
148
        /*# string */ $from,
149
        /*# string */ $to
150
    )/*# : bool */ {
151
        return false;
152
    }
153
154
    /**
155
     * {@inheritDoc}
156
     */
157
    protected function copyFile(
158
        /*# string */ $from,
159
        /*# string */ $to
160
    )/*# : bool */ {
161
        return false;
162
    }
163
164
    /**
165
     * {@inheritDoc}
166
     */
167
    protected function deleteDir(/*# string */ $realPath)/*# : bool */
168
    {
169
        return false;
170
    }
171
172
    /**
173
     * {@inheritDoc}
174
     */
175
    protected function deleteFile(/*# string */ $realPath)/*# : bool */
176
    {
177
        return false;
178
    }
179
}
180