Passed
Push — master ( d467ff...321125 )
by Petr
08:04
created

ProcessNode   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 44
ccs 18
cts 18
cp 1
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A exists() 0 3 1
A __construct() 0 4 1
A created() 0 3 1
A isDir() 0 3 1
A isFile() 0 3 1
A size() 0 3 1
A isWritable() 0 3 1
A isReadable() 0 3 1
1
<?php
2
3
namespace kalanis\kw_files\Processing\Storage;
4
5
6
use kalanis\kw_files\Interfaces\IFLTranslations;
7
use kalanis\kw_files\Interfaces\IProcessNodes;
8
use kalanis\kw_storage\Interfaces\IStorage;
9
10
11
/**
12
 * Class ProcessNode
13
 * @package kalanis\kw_files\Processing\Storage
14
 * Process nodes in storages
15
 */
16
class ProcessNode implements IProcessNodes
17
{
18
    /** @var IProcessNodes */
19
    protected $adapter = null;
20
21 18
    public function __construct(IStorage $storage, ?IFLTranslations $lang = null)
22
    {
23 18
        $factory = new Nodes\Factory();
24 18
        $this->adapter = $factory->getClass($storage, $lang);
25 18
    }
26
27 9
    public function exists(array $entry): bool
28
    {
29 9
        return $this->adapter->exists($entry);
30
    }
31
32 2
    public function isReadable(array $entry): bool
33
    {
34 2
        return $this->adapter->isReadable($entry);
35
    }
36
37 2
    public function isWritable(array $entry): bool
38
    {
39 2
        return $this->adapter->isWritable($entry);
40
    }
41
42 9
    public function isDir(array $entry): bool
43
    {
44 9
        return $this->adapter->isDir($entry);
45
    }
46
47 5
    public function isFile(array $entry): bool
48
    {
49 5
        return $this->adapter->isFile($entry);
50
    }
51
52 4
    public function size(array $entry): ?int
53
    {
54 4
        return $this->adapter->size($entry);
55
    }
56
57 3
    public function created(array $entry): ?int
58
    {
59 3
        return $this->adapter->created($entry);
60
    }
61
}
62