HydrationStrategy   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getStrategy() 0 3 1
A getArgs() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Maiorano\ObjectHydrator\Attributes;
4
5
use Attribute;
6
7
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
8
final class HydrationStrategy
9
{
10
    /**
11
     * @var string
12
     */
13
    private string $strategy;
14
    /**
15
     * @var array
16
     */
17
    private array $args;
18
19
    /**
20
     * @param string $strategy
21
     * @param mixed  ...$args
22
     */
23 7
    public function __construct(string $strategy, mixed ...$args)
24
    {
25 7
        $this->strategy = $strategy;
26 7
        $this->args = $args;
27 7
    }
28
29
    /**
30
     * @return string
31
     */
32 6
    public function getStrategy(): string
33
    {
34 6
        return $this->strategy;
35
    }
36
37
    /**
38
     * @return array
39
     */
40 6
    public function getArgs(): array
41
    {
42 6
        return $this->args;
43
    }
44
}
45