TemplateFinder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 1
1
<?php
2
/**
3
 * This file is part of the Madapaja.TwigModule package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace Madapaja\TwigModule;
8
9
class TemplateFinder implements TemplateFinderInterface
10
{
11
    const PHP_EXT = '.php';
12
13
    const TWIG_EXT = '.html.twig';
14
15
    /**
16
     * {@inheritdoc}
17
     */
18 9
    public function __invoke($name)
19
    {
20 9
        $pos = strrpos($name, self::PHP_EXT);
21 9
        $file = substr($name, 0, $pos) . self::TWIG_EXT;
22
23 9
        return $file;
24
    }
25
}
26