Passed
Push — main ( df8d6f...066d74 )
by Anatoly
04:33 queued 15s
created

DefaultValue::__construct()   A

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 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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
    /**
34
     * The attribute value
35
     *
36
     * @var mixed
37
     *
38
     * @readonly
39
     */
40
    public $value;
41
42
    /**
43
     * Constructor of the class
44
     *
45
     * @param mixed $value
46
     */
47 1
    public function __construct($value)
48
    {
49 1
        $this->value = $value;
50
    }
51
}
52