HTMLUtils   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
c 2
b 0
f 0
dl 0
loc 23
ccs 0
cts 10
cp 0
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A copyThemes() 0 6 1
A ensureEmptyDestination() 0 6 2
1
<?php namespace Todaymade\Daux\Format\HTML;
2
3
use Todaymade\Daux\GeneratorHelper;
4
5
trait HTMLUtils
6
{
7
    public function ensureEmptyDestination($destination)
8
    {
9
        if (is_dir($destination)) {
10
            GeneratorHelper::rmdir($destination);
11
        } else {
12
            mkdir($destination);
13
        }
14
    }
15
16
    /**
17
     * Copy all files from $local to $destination.
18
     *
19
     * @param string $destination
20
     * @param string $local_base
21
     */
22
    public function copyThemes($destination, $local_base)
23
    {
24
        mkdir($destination . DIRECTORY_SEPARATOR . 'themes');
25
        GeneratorHelper::copyRecursive(
26
            $local_base,
27
            $destination . DIRECTORY_SEPARATOR . 'themes'
28
        );
29
    }
30
}
31