Passed
Push — master ( 8aa27c...271cba )
by Caen
03:44 queued 13s
created

Site::path()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
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
10
/**
11
 * Object representation for the HydePHP site and its configuration.
12
 *
13
 * @see \Hyde\Framework\Testing\Feature\SiteTest
14
 */
15
final class Site
16
{
17
    public static function url(): ?string
18
    {
19
        return config('site.url');
20
    }
21
22
    public static function name(): ?string
23
    {
24
        return config('site.name');
25
    }
26
27
    public static function language(): ?string
28
    {
29
        return config('site.language');
30
    }
31
32
    public static function metadata(): GlobalMetadataBag
33
    {
34
        return GlobalMetadataBag::make();
35
    }
36
37
    public static function path(string $path = ''): string
38
    {
39
        return Hyde::kernel()->sitePath($path);
40
    }
41
42
    public static function getOutputDirectory(): string
43
    {
44
        return Hyde::kernel()->getOutputDirectory();
45
    }
46
47
    public static function setOutputDirectory(string $outputDirectory): void
48
    {
49
        Hyde::kernel()->setOutputDirectory($outputDirectory);
50
    }
51
}
52