ClassWithMixedPropertiesAndAccessorMethods::has()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ProxyManagerTestAsset;
6
7
/**
8
 * Class with one abstract public method
9
 *
10
 * @author Marco Pivetta <[email protected]>
11
 * @license MIT
12
 */
13
class ClassWithMixedPropertiesAndAccessorMethods
14
{
15
    /**
16
     * @var mixed
17
     */
18
    public $publicProperty = 'publicProperty';
19
20
    /**
21
     * @var mixed
22
     */
23
    protected $protectedProperty = 'protectedProperty';
24
25
    /**
26
     * @var mixed
27
     */
28
    private $privateProperty = 'privateProperty';
29
30
    /**
31
     * @param string $name
32
     *
33
     * @return bool
34
     */
35
    public function has($name)
36
    {
37
        return isset($this->$name);
38
    }
39
40
    /**
41
     * @param string $name
42
     *
43
     * @return mixed
44
     */
45
    public function get($name)
46
    {
47
        return $this->$name;
48
    }
49
50
    /**
51
     * @param string $name
52
     * @param mixed  $value
53
     *
54
     * @return void
55
     */
56
    public function set($name, $value)
57
    {
58
        $this->$name = $value;
59
    }
60
61
    /**
62
     * @param string $name
63
     *
64
     * @return void
65
     */
66
    public function remove($name)
67
    {
68
        unset($this->$name);
69
    }
70
}
71