ProcessDir   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 33
ccs 13
cts 13
cp 1
rs 10
c 1
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A copyDir() 0 3 1
A createDir() 0 3 1
A readDir() 0 3 1
A moveDir() 0 3 1
A __construct() 0 4 1
A deleteDir() 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\IProcessDirs;
8
use kalanis\kw_storage\Interfaces\IStorage;
9
10
11
/**
12
 * Class ProcessDir
13
 * @package kalanis\kw_files\Processing\Storage
14
 * Process dirs in storages
15
 */
16
class ProcessDir implements IProcessDirs
17
{
18
    protected IProcessDirs $adapter;
19
20 83
    public function __construct(IStorage $storage, ?IFLTranslations $lang = null)
21
    {
22 83
        $factory = new Dirs\Factory();
23 83
        $this->adapter = $factory->getClass($storage, $lang);
24
    }
25
26 22
    public function createDir(array $entry, bool $deep = false): bool
27
    {
28 22
        return $this->adapter->createDir($entry, $deep);
29
    }
30
31 19
    public function readDir(array $entry, bool $loadRecursive = false, bool $wantSize = false): array
32
    {
33 19
        return $this->adapter->readDir($entry, $loadRecursive, $wantSize);
34
    }
35
36 18
    public function copyDir(array $source, array $dest): bool
37
    {
38 18
        return $this->adapter->copyDir($source, $dest);
39
    }
40
41 18
    public function moveDir(array $source, array $dest): bool
42
    {
43 18
        return $this->adapter->moveDir($source, $dest);
44
    }
45
46 22
    public function deleteDir(array $entry, bool $deep = false): bool
47
    {
48 22
        return $this->adapter->deleteDir($entry, $deep);
49
    }
50
}
51