LayoutSourceFilter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 12
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A matchesFileSource() 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\Source\SourceFileFilter;
11
12
use Nette\Utils\Strings;
13
use SplFileInfo;
14
use Symplify\PHP7_Sculpin\Contract\Source\SourceFileFilter\SourceFileFilterInterface;
15
use Symplify\PHP7_Sculpin\Source\SourceFileTypes;
16
17
final class LayoutSourceFilter implements SourceFileFilterInterface
18
{
19 5
    public function getName() : string
20
    {
21 5
        return SourceFileTypes::LAYOUTS;
22
    }
23
24 2
    public function matchesFileSource(SplFileInfo $fileInfo) : bool
25
    {
26 2
        return Strings::contains($fileInfo, '_layouts');
27
    }
28
}
29