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

StorageDirs   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
dl 0
loc 53
ccs 20
cts 20
cp 1
rs 10
c 1
b 0
f 0
wmc 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A isDir() 0 3 1
A isFile() 0 3 1
A copy() 0 3 1
A size() 0 3 1
A mkDir() 0 3 1
A isWritable() 0 3 1
A move() 0 3 1
A isReadable() 0 3 1
A created() 0 3 1
A rmDir() 0 3 1
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