HydrationStrategy::getArgs()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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