HydrationKey   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getKey() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace Maiorano\ObjectHydrator\Attributes;
4
5
use Attribute;
6
7
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_METHOD)]
8
final class HydrationKey
9
{
10
    /**
11
     * @var string
12
     */
13
    private string $key;
14
15
    /**
16
     * @param string $key
17
     */
18 23
    public function __construct(string $key)
19
    {
20 23
        $this->key = $key;
21 23
    }
22
23
    /**
24
     * @return string
25
     */
26 16
    public function getKey(): string
27
    {
28 16
        return $this->key;
29
    }
30
}
31