LfiProtectionTrait::setLfiProtection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace AssetManager\Core\Resolver;
4
5
trait LfiProtectionTrait
6
{
7
    /**
8
     * Flag indicating whether or not LFI protection for rendering view scripts is enabled
9
     *
10
     * @var bool
11
     */
12
    protected $lfiProtectionOn = true;
13
14
    /**
15
     * Set LFI protection flag
16
     *
17
     * @param  bool $flag
18
     * @return void
19
     */
20
    public function setLfiProtection($flag)
21
    {
22
        $this->lfiProtectionOn = (bool) $flag;
23
    }
24
25
    /**
26
     * Return status of LFI protection flag
27
     *
28
     * @return bool
29
     */
30
    public function isLfiProtectionOn()
31
    {
32
        return $this->lfiProtectionOn;
33
    }
34
}
35