FileExtension   A
last analyzed

↳ Parent: Project

Coupling/Cohesion

Components 0
Dependencies 0

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 38
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A set() 0 6 1
A get() 0 4 1
1
<?php
2
3
namespace League\Plates\Template;
4
5
/**
6
 * Template file extension.
7
 */
8
class FileExtension
9
{
10
    /**
11
     * Template file extension.
12
     * @var string
13
     */
14
    protected $fileExtension;
15
16
    /**
17
     * Create new FileExtension instance.
18
     * @param null|string $fileExtension
19
     */
20 332
    public function __construct($fileExtension = 'php')
21
    {
22 332
        $this->set($fileExtension);
23 332
    }
24
25
    /**
26
     * Set the template file extension.
27
     * @param  null|string   $fileExtension
28
     * @return FileExtension
29
     */
30 332
    public function set($fileExtension)
31
    {
32 332
        $this->fileExtension = $fileExtension;
33
34 332
        return $this;
35
    }
36
37
    /**
38
     * Get the template file extension.
39
     * @return string
40
     */
41 212
    public function get()
42
    {
43 212
        return $this->fileExtension;
44
    }
45
}
46