WithMagicPropertiesChildClass   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 55
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getReadOnlyChildProperty() 0 3 1
A getChildProperty() 0 3 1
A setChildProperty() 0 3 1
A __construct() 0 4 1
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     1.0.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
/**
23
 * @internal
24
 * @property string      $childProperty
25
 * @property-read string $readOnlyChildProperty
26
 *
27
 * @since 1.0.0
28
 */
29
class WithMagicPropertiesChildClass extends WithMagicPropertiesBaseClass
30
{
31
    /**
32
     * [__construct description]
33
     *
34
     * @param int $readOnlyChildProperty
35
     */
36
    public function __construct($readOnlyChildProperty = 1)
37
    {
38
        $this->childProperty_         = 'child';
39
        $this->readOnlyChildProperty_ = $readOnlyChildProperty;
40
    }
41
42
    /**
43
     *
44
     * @var string
45
     */
46
    private $childProperty_;
47
48
    /**
49
     *
50
     *
51
     * @var int
52
     */
53
    private $readOnlyChildProperty_ = -1;
54
55
56
    /**
57
     *
58
     *
59
     * @return string
60
     */
61
    protected function getChildProperty(): string
62
    {
63
        return $this->childProperty_;
64
    }
65
66
    /**
67
     *
68
     * @param string $value
69
     */
70
    protected function setChildProperty(string $value)
71
    {
72
        $this->childProperty_ = $value;
73
    }
74
75
76
    /**
77
     *
78
     *
79
     * @return int
80
     */
81
    protected function getReadOnlyChildProperty(): int
82
    {
83
        return $this->readOnlyChildProperty_;
84
    }
85
}
86