DefaultValue   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
1
<?php
2
3
/**
4
 * It's free open-source software released under the MIT License.
5
 *
6
 * @author Anatoly Nekhay <[email protected]>
7
 * @copyright Copyright (c) 2021, Anatoly Nekhay
8
 * @license https://github.com/sunrise-php/hydrator/blob/master/LICENSE
9
 * @link https://github.com/sunrise-php/hydrator
10
 */
11
12
declare(strict_types=1);
13
14
namespace Sunrise\Hydrator\Annotation;
15
16
use Attribute;
17
18
/**
19
 * @Annotation
20
 * @Target({"PROPERTY"})
21
 * @NamedArgumentConstructor
22
 *
23
 * @Attributes({
24
 *     @Attribute("value", type="mixed", required=true),
25
 * })
26
 *
27
 * @since 3.12.0
28
 */
29
#[Attribute(Attribute::TARGET_PROPERTY)]
30
final class DefaultValue
31
{
32
    /**
33
     * @var mixed
34
     *
35
     * @readonly
36
     */
37
    public $value;
38
39
    /**
40
     * @param mixed $value
41
     */
42 1
    public function __construct($value)
43
    {
44 1
        $this->value = $value;
45
    }
46
}
47