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

IndexRoute   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A matches() 0 4 1
A buildOutputPath() 0 4 1
A buildRelativeUrl() 0 4 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