Passed
Push — master ( 4570a8...dbcdaa )
by Petr
03:01
created

StorageDirs::isWritable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace kalanis\kw_storage\Storage;
4
5
6
use kalanis\kw_storage\Interfaces\IPassDirs;
7
use kalanis\kw_storage\Interfaces\ITargetVolume;
8
9
10
/**
11
 * Class StorageDirs
12
 * @package kalanis\kw_storage
13
 * Extended storage class
14
 */
15
class StorageDirs extends Storage implements IPassDirs
16
{
17
    /** @var ITargetVolume */
18
    protected $target = null;
19
20 4
    public function isDir(string $key): bool
21
    {
22 4
        return $this->target->isDir($this->key->fromSharedKey($key));
23
    }
24
25 1
    public function isFile(string $key): bool
26
    {
27 1
        return $this->target->isFile($this->key->fromSharedKey($key));
28
    }
29
30 2
    public function isReadable(string $key): bool
31
    {
32 2
        return $this->target->isReadable($this->key->fromSharedKey($key));
33
    }
34
35 2
    public function isWritable(string $key): bool
36
    {
37 2
        return $this->target->isWritable($this->key->fromSharedKey($key));
38
    }
39
40 1
    public function mkDir(string $key, bool $recursive = false): bool
41
    {
42 1
        return $this->target->mkDir($this->key->fromSharedKey($key), $recursive);
43
    }
44
45 1
    public function rmDir(string $key, bool $recursive = false): bool
46
    {
47 1
        return $this->target->rmDir($this->key->fromSharedKey($key), $recursive);
48
    }
49
50 1
    public function copy(string $source, string $dest): bool
51
    {
52 1
        return $this->target->copy($this->key->fromSharedKey($source), $this->key->fromSharedKey($dest));
53
    }
54
55 1
    public function move(string $source, string $dest): bool
56
    {
57 1
        return $this->target->move($this->key->fromSharedKey($source), $this->key->fromSharedKey($dest));
58
    }
59
60 1
    public function size(string $key): ?int
61
    {
62 1
        return $this->target->size($this->key->fromSharedKey($key));
63
    }
64
65 1
    public function created(string $key): ?int
66
    {
67 1
        return $this->target->created($this->key->fromSharedKey($key));
68
    }
69
}
70