Passed
Push — master ( b4279a...848647 )
by Caen
03:11 queued 12s
created

Site::setOutputPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Hyde\Facades;
6
7
use Hyde\Framework\Features\Metadata\GlobalMetadataBag;
8
use Hyde\Hyde;
9
use function unslash;
10
11
/**
12
 * Object representation for the HydePHP site and its configuration.
13
 *
14
 * @see \Hyde\Framework\Testing\Feature\SiteTest
15
 */
16
final class Site
17
{
18
    protected static string $outputPath = '_site';
19
20
    public static function url(): ?string
21
    {
22
        return config('site.url');
23
    }
24
25
    public static function name(): ?string
26
    {
27
        return config('site.name');
28
    }
29
30
    public static function language(): ?string
31
    {
32
        return config('site.language');
33
    }
34
35
    public static function metadata(): GlobalMetadataBag
36
    {
37
        return GlobalMetadataBag::make();
38
    }
39
40
    public static function getOutputPath(): string
41
    {
42
        return self::$outputPath;
43
    }
44
45
    public static function setOutputPath(string $outputPath): void
46
    {
47
        self::$outputPath = unslash(Hyde::pathToRelative($outputPath));
48
    }
49
}
50