Completed
Pull Request — master (#1)
by Mathieu
04:21
created

PhpLoader::load()   C

Complexity

Conditions 8
Paths 14

Size

Total Lines 48
Code Lines 27

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 48
rs 5.9322
cc 8
eloc 27
nc 14
nop 1
1
<?php
2
3
namespace Charcoal\View\Php;
4
5
// PHP Dependencies
6
use \InvalidArgumentException;
7
8
// Parent namespace dependencies
9
use \Charcoal\View\AbstractLoader;
10
use \Charcoal\View\LoaderInterface;
11
12
/**
13
 * The PHP template loader finds a mustache php template file in directories and includes it (run as PHP).
14
 */
15
class PhpLoader extends AbstractLoader implements LoaderInterface
16
{
17
    /**
18
     * Convert an identifier to a file path.
19
     *
20
     * @param string $ident The identifier to convert.
21
     * @return string
22
     */
23
    protected function filenameFromIdent($ident)
24
    {
25
        $filename = str_replace([ '\\' ], '.', $ident);
26
        $filename .= '.php';
27
28
        return $filename;
29
    }
30
}
31