Completed
Push — master ( 5bd517...c7b86e )
by Tomáš
08:52
created

IndexRoute::buildOutputPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Symplify
7
 * Copyright (c) 2016 Tomas Votruba (http://tomasvotruba.cz).
8
 */
9
10
namespace Symplify\PHP7_Sculpin\Renderable\Routing\Route;
11
12
use Symplify\PHP7_Sculpin\Contract\Renderable\Routing\Route\RouteInterface;
13
use Symplify\PHP7_Sculpin\Renderable\File\AbstractFile;
14
use Symplify\PHP7_Sculpin\Renderable\File\File;
15
16
final class IndexRoute implements RouteInterface
17
{
18
    public function matches(AbstractFile $file) : bool
19
    {
20
        return $file->getBaseName() === 'index';
21
    }
22
23
    public function buildOutputPath(AbstractFile $file) : string
24
    {
25
        return 'index.html';
26
    }
27
28
    public function buildRelativeUrl(AbstractFile $file) : string
29
    {
30
        return '/';
31
    }
32
}
33