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

PhpLoader::classnameToIdent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
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