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

HtmlPage::contents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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