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

XmlNamespace   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JMS\Serializer\Annotation;
6
7
/**
8
 * @Annotation
9
 * @Target("CLASS")
10
 */
11
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
12
final class XmlNamespace
13
{
14
    /**
15
     * @Required
16
     * @var string|null
17
     */
18
    public $uri = null;
19
20
    /**
21
     * @var string
22
     */
23
    public $prefix = '';
24
25
    public function __construct(array $values = [], ?string $uri = null, string $prefix = '')
26
    {
27
        if (array_key_exists('uri', $values)) {
28
            $uri = $values['uri'];
29
        }
30
31
        if (array_key_exists('prefix', $values)) {
32
            $prefix = $values['prefix'];
33
        }
34
35
        $this->uri = $uri;
36
        $this->prefix = $prefix;
37
    }
38
}
39