C::getValueOfAttribute5()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 1
c 1
b 1
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * PHP: Nelson Martell Library file
5
 *
6
 * Copyright © 2016-2021 Nelson Martell (http://nelson6e65.github.io)
7
 *
8
 * Licensed under The MIT License (MIT)
9
 * For full copyright and license information, please see the LICENSE
10
 * Redistributions of files must retain the above copyright notice.
11
 *
12
 * @copyright 2016-2021 Nelson Martell
13
 * @link      http://nelson6e65.github.io/php_nml/
14
 * @since     v0.6.0
15
 * @license   http://www.opensource.org/licenses/mit-license.php The MIT License (MIT)
16
 * */
17
18
declare(strict_types=1);
19
20
namespace NelsonMartell\Test\DataProviders\ExampleClass;
21
22
use NelsonMartell\ICustomPrefixedPropertiesContainer;
23
24
class C extends B implements ICustomPrefixedPropertiesContainer
25
{
26
    public function __construct()
27
    {
28
        parent::__construct();
29
        unset(
30
            $this->property5,
0 ignored issues
show
Bug Best Practice introduced by
The property property5 does not exist on NelsonMartell\Test\DataProviders\ExampleClass\C. Since you implemented __get, consider adding a @property annotation.
Loading history...
31
            $this->property6,
32
            $this->property7
33
        );
34
    }
35
36
    public static function getCustomGetterPrefix(): string
37
    {
38
        return 'getValueOf';
39
    }
40
41
    public static function getCustomSetterPrefix(): string
42
    {
43
        return 'setValueOf';
44
    }
45
46
47
    private $attribute5 = -5;
48
49
    public function getValueOfAttribute5()
50
    {
51
        return $this->attribute5 * 2;
52
    }
53
54
    private $attribute6 = -6;
55
    public $property6;
56
57
    protected function getValueOfProperty6()
58
    {
59
        return $this->attribute6;
60
    }
61
62
    protected function setValueOfProperty6($value)
63
    {
64
        $this->property6 = $value * 99;
65
    }
66
67
    private $attribute7 = -7;
0 ignored issues
show
introduced by
The private property $attribute7 is not used, and could be removed.
Loading history...
68
    public $property7;
69
70
    /**
71
     * Wrong prefix getter; will never be called
72
     */
73
    protected function getProperty7()
74
    {
75
        return $this->property7;
76
    }
77
}
78