Completed
Pull Request — master (#153)
by Harry
02:35
created

FileExtension::set()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1.064

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
ccs 3
cts 5
cp 0.6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1.064
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 166
    public function __construct($fileExtension = 'php')
21
    {
22 166
        $this->set($fileExtension);
23 166
    }
24
25
    /**
26
     * Set the template file extension.
27
     * @param  null|string   $fileExtension
28
     * @return FileExtension
29
     */
30 166
    public function set($fileExtension)
31
    {
32 166
        $this->fileExtension = $fileExtension;
33
34 166
        return $this;
35
    }
36
37
    /**
38
     * Get the template file extension.
39
     * @return string
40
     */
41 106
    public function get()
42
    {
43 106
        return $this->fileExtension;
44
    }
45
}
46