Passed
Push — master ( 943ae1...8d2cd7 )
by Caen
02:58 queued 11s
created

HtmlPage   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 19
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A compile() 0 3 1
A contents() 0 3 1
A getBladeView() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Hyde\Pages;
6
7
use Hyde\Pages\Concerns\HydePage;
8
9
/**
10
 * Page class for HTML pages.
11
 *
12
 * Html pages are stored in the _pages directory and using the .html extension.
13
 * These pages will be copied exactly as they are to the _site/ directory.
14
 *
15
 * @see https://hydephp.com/docs/master/static-pages#bonus-creating-html-pages
16
 */
17
class HtmlPage extends HydePage
18
{
19
    public static string $sourceDirectory = '_pages';
20
    public static string $outputDirectory = '';
21
    public static string $fileExtension = '.html';
22
23
    public function contents(): string
24
    {
25
        return file_get_contents($this->getSourcePath());
26
    }
27
28
    public function compile(): string
29
    {
30
        return $this->contents();
31
    }
32
33
    public function getBladeView(): string
34
    {
35
        return $this->getSourcePath();
36
    }
37
}
38