Passed
Push — v7 ( ba093b...24d66b )
by Georges
02:14
created

Config::setSecurityKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Geolim4
5
 * Date: 12/02/2018
6
 * Time: 23:10
7
 */
8
9
namespace Phpfastcache\Drivers\Files;
10
11
use Phpfastcache\Config\ConfigurationOption;
12
13
class Config extends ConfigurationOption
14
{
15
    /**
16
     * @var boolean
17
     */
18
    protected $secureFileManipulation = false;
19
20
    /**
21
     * @var string
22
     */
23
    protected $htaccess = true;
24
25
    /**
26
     * @var string
27
     */
28
    protected $securityKey = '';
29
30
    /**
31
     * @return string
32
     */
33
    public function getSecurityKey(): string
34
    {
35
        return $this->securityKey;
36
    }
37
38
    /**
39
     * @param string $securityKey
40
     * @return Config
41
     */
42
    public function setSecurityKey(string $securityKey): Config
43
    {
44
        $this->securityKey = $securityKey;
45
        return $this;
46
    }
47
48
    /**
49
     * @return bool
50
     */
51
    public function getHtaccess(): bool
52
    {
53
        return $this->htaccess;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->htaccess returns the type string which is incompatible with the type-hinted return boolean.
Loading history...
54
    }
55
56
    /**
57
     * @param bool $htaccess
58
     * @return Config
59
     */
60
    public function setHtaccess(bool $htaccess): self
61
    {
62
        $this->htaccess = $htaccess;
0 ignored issues
show
Documentation Bug introduced by
The property $htaccess was declared of type string, but $htaccess is of type boolean. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
63
        return $this;
64
    }
65
66
    /**
67
     * @return bool
68
     */
69
    public function isSecureFileManipulation(): bool
70
    {
71
        return $this->secureFileManipulation;
72
    }
73
74
    /**
75
     * @param bool $secureFileManipulation
76
     * @return self
77
     */
78
    public function setSecureFileManipulation(bool $secureFileManipulation): self
79
    {
80
        $this->secureFileManipulation = $secureFileManipulation;
81
        return $this;
82
    }
83
}