Passed
Pull Request — master (#1320)
by
unknown
02:52
created

Version   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 21
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 4
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JMS\Serializer\Annotation;
6
7
abstract class Version
8
{
9
    /**
10
     * @Required
11
     * @var string|null
12
     */
13
    public $version = null;
14
15
    public function __construct(array $values = [], ?string $version = null)
16
    {
17
        if (0 !== count($values)) {
18
            if (array_key_exists('value', $values)) {
19
                $version = $values['value'];
20
            }
21
22
            if (array_key_exists('version', $values)) {
23
                $version = $values['version'];
24
            }
25
        }
26
27
        $this->version = $version;
28
    }
29
}
30