NullAdapter   A
last analyzed

Complexity

Total Complexity 16

Size/Duplication

Total Lines 136
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 16
lcom 0
cbo 4
dl 0
loc 136
ccs 35
cts 35
cp 1
rs 10
c 0
b 0
f 0

15 Methods

Rating   Name   Duplication   Size   Complexity  
A has() 0 4 1
A update() 0 4 1
A read() 0 4 1
A rename() 0 4 1
A delete() 0 4 1
A listContents() 0 4 1
A getMetadata() 0 4 1
A getSize() 0 4 1
A getMimetype() 0 4 1
A getTimestamp() 0 4 1
A getVisibility() 0 4 1
A setVisibility() 0 4 1
A createDir() 0 4 1
A deleteDir() 0 4 1
A write() 0 11 2
1
<?php
2
3
namespace League\Flysystem\Adapter;
4
5
use League\Flysystem\Adapter\Polyfill\StreamedCopyTrait;
6
use League\Flysystem\Adapter\Polyfill\StreamedTrait;
7
use League\Flysystem\Config;
8
9
class NullAdapter extends AbstractAdapter
10
{
11
    use StreamedTrait;
12
    use StreamedCopyTrait;
13
14
    /**
15
     * Check whether a file is present.
16
     *
17
     * @param string $path
18
     *
19
     * @return bool
20
     */
21 9
    public function has($path)
22
    {
23 9
        return false;
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29 6
    public function write($path, $contents, Config $config)
30
    {
31 6
        $type = 'file';
32 6
        $result = compact('contents', 'type', 'path');
33
34 6
        if ($visibility = $config->get('visibility')) {
35 3
            $result['visibility'] = $visibility;
36 1
        }
37
38 6
        return $result;
39
    }
40
41
    /**
42
     * @inheritdoc
43
     */
44 3
    public function update($path, $contents, Config $config)
45
    {
46 3
        return false;
47
    }
48
49
    /**
50
     * @inheritdoc
51
     */
52 6
    public function read($path)
53
    {
54 6
        return false;
55
    }
56
57
    /**
58
     * @inheritdoc
59
     */
60 3
    public function rename($path, $newpath)
61
    {
62 3
        return false;
63
    }
64
65
    /**
66
     * @inheritdoc
67
     */
68 6
    public function delete($path)
69
    {
70 6
        return false;
71
    }
72
73
    /**
74
     * @inheritdoc
75
     */
76 3
    public function listContents($directory = '', $recursive = false)
77
    {
78 3
        return [];
79
    }
80
81
    /**
82
     * @inheritdoc
83
     */
84 3
    public function getMetadata($path)
85
    {
86 3
        return false;
87
    }
88
89
    /**
90
     * @inheritdoc
91
     */
92 3
    public function getSize($path)
93
    {
94 3
        return false;
95
    }
96
97
    /**
98
     * @inheritdoc
99
     */
100 3
    public function getMimetype($path)
101
    {
102 3
        return false;
103
    }
104
105
    /**
106
     * @inheritdoc
107
     */
108 3
    public function getTimestamp($path)
109
    {
110 3
        return false;
111
    }
112
113
    /**
114
     * @inheritdoc
115
     */
116 3
    public function getVisibility($path)
117
    {
118 3
        return false;
119
    }
120
121
    /**
122
     * @inheritdoc
123
     */
124 3
    public function setVisibility($path, $visibility)
125
    {
126 3
        return compact('visibility');
127
    }
128
129
    /**
130
     * @inheritdoc
131
     */
132 3
    public function createDir($dirname, Config $config)
133
    {
134 3
        return ['path' => $dirname, 'type' => 'dir'];
135
    }
136
137
    /**
138
     * @inheritdoc
139
     */
140 3
    public function deleteDir($dirname)
141
    {
142 3
        return false;
143
    }
144
}
145