Passed
Pull Request — master (#1332)
by Asmir
02:29
created

XmlCollection   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 44
rs 10
c 0
b 0
f 0
wmc 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 22 5
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JMS\Serializer\Annotation;
6
7
abstract class XmlCollection
8
{
9
    /**
10
     * @var string
11
     */
12
    public $entry = 'entry';
13
14
    /**
15
     * @var bool
16
     */
17
    public $inline = false;
18
19
    /**
20
     * @var string|null
21
     */
22
    public $namespace = null;
23
24
    /**
25
     * @var bool
26
     */
27
    public $skipWhenEmpty = true;
28
29
    public function __construct(array $values = [], string $entry = 'entry', bool $inline = false, ?string $namespace = null, bool $skipWhenEmpty = true)
30
    {
31
        if (array_key_exists('entry', $values)) {
32
            $entry = $values['entry'];
33
        }
34
35
        if (array_key_exists('inline', $values)) {
36
            $inline = $values['inline'];
37
        }
38
39
        if (array_key_exists('namespace', $values)) {
40
            $namespace = $values['namespace'];
41
        }
42
43
        if (array_key_exists('skipWhenEmpty', $values)) {
44
            $skipWhenEmpty = $values['skipWhenEmpty'];
45
        }
46
47
        $this->entry = $entry;
48
        $this->inline = $inline;
49
        $this->namespace = $namespace;
50
        $this->skipWhenEmpty = $skipWhenEmpty;
51
    }
52
}
53