Since::init()   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 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 * Copyright (c) Nate Brunette.
4
 * Distributed under the MIT License (http://opensource.org/licenses/MIT)
5
 */
6
7
declare(strict_types=1);
8
9
namespace Tebru\Gson\Annotation;
10
11
use Tebru\AnnotationReader\AbstractAnnotation;
12
13
/**
14
 * Class Since
15
 *
16
 * Used to exclude classes or properties that should not be serialized if the version number
17
 * is less than the @Since value.  Will not be used if version number is not defined on the
18
 * builder.
19
 *
20
 * @author Nate Brunette <[email protected]>
21
 *
22
 * @Annotation
23
 * @Target({"CLASS", "PROPERTY", "METHOD"})
24
 */
25
class Since extends AbstractAnnotation
26
{
27
    /**
28
     * Initialize annotation data
29
     */
30 2
    protected function init(): void
31
    {
32 2
        $this->value = (string)$this->getValue();
33 1
    }
34
}
35