ProcessDir::deleteDir()   A
last analyzed

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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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