Passed
Push — main ( 84aa38...cd593b )
by Michael
03:56 queued 21s
created

WithDynamicProperties   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 21
ccs 4
cts 4
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __get() 0 3 1
A __set() 0 3 1
1
<?php
2
3
namespace MichaelRubel\LoopFunctions\Traits;
4
5
trait WithDynamicProperties
6
{
7
    /**
8
     * @param string $name
9
     *
10
     * @return mixed
11
     */
12 1
    public function __get(string $name): mixed
13
    {
14 1
        return $this->{$name};
15
    }
16
17
    /**
18
     * @param string $name
19
     * @param mixed  $value
20
     *
21
     * @return void
22
     */
23 1
    public function __set(string $name, mixed $value): void
24
    {
25 1
        $this->{$name} = $value;
26
    }
27
}
28