Property   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A name() 0 3 1
A create() 0 3 1
A __construct() 0 4 1
A value() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Th3Mouk\ReactiveKlaviyo;
6
7
final class Property
8
{
9
    /** @var string */
10
    private $name;
11
    /** @var string|int|float|bool|array<string|int|float|bool> */
12
    private $value;
13
14
    /**
15
     * @param string|int|float|bool|array<string|int|float|bool> $value
16
     */
17
    private function __construct(string $name, $value)
18
    {
19
        $this->name  = $name;
20
        $this->value = $value;
21
    }
22
23
    /**
24
     * @param string|int|float|bool|array<string|int|float|bool> $value
25
     */
26
    public static function create(string $name, $value): self
27
    {
28
        return new self($name, $value);
29
    }
30
31
    public function name(): string
32
    {
33
        return $this->name;
34
    }
35
36
    /**
37
     * @return string|int|float|bool|array<string|int|float|bool>
38
     */
39
    public function value()
40
    {
41
        return $this->value;
42
    }
43
}
44