Xml   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 72
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getNamespace() 0 3 1
A isWrapped() 0 3 1
A isAttribute() 0 3 1
A __construct() 0 3 1
A getPrefix() 0 3 1
A getName() 0 3 1
1
<?php
2
3
4
namespace Apie\OpenapiSchema\Spec;
5
6
use Apie\CommonValueObjects\KebabCaseString;
7
use Apie\CommonValueObjects\Url;
8
use Apie\OpenapiSchema\Concerns\CompositeValueObjectWithExtension;
9
use Apie\OpenapiSchema\ValueObjects\SpecificationExtension;
10
use Apie\ValueObjects\ValueObjectInterface;
11
12
/**
13
 * @see https://swagger.io/specification/#xml-object
14
 */
15
class Xml implements ValueObjectInterface
16
{
17
    use CompositeValueObjectWithExtension;
18
19
    public function __construct()
20
    {
21
        $this->specificationExtension = new SpecificationExtension([]);
22
    }
23
24
    /**
25
     * @var KebabCaseString|null
26
     */
27
    private $name;
28
29
    /**
30
     * @var Url|null
31
     */
32
    private $namespace;
33
34
    /**
35
     * @var KebabCaseString|null
36
     */
37
    private $prefix;
38
39
    /**
40
     * @var bool|null
41
     */
42
    private $attribute;
43
44
    /**
45
     * @var bool|null
46
     */
47
    private $wrapped;
48
49
    /**
50
     * @return KebabCaseString|null
51
     */
52
    public function getName(): ?KebabCaseString
53
    {
54
        return $this->name;
55
    }
56
57
    /**
58
     * @return Url|null
59
     */
60
    public function getNamespace(): ?Url
61
    {
62
        return $this->namespace;
63
    }
64
65
    /**
66
     * @return KebabCaseString|null
67
     */
68
    public function getPrefix(): ?KebabCaseString
69
    {
70
        return $this->prefix;
71
    }
72
73
    /**
74
     * @return bool
75
     */
76
    public function isAttribute(): bool
77
    {
78
        return $this->attribute ?? false;
79
    }
80
81
    /**
82
     * @return bool
83
     */
84
    public function isWrapped(): bool
85
    {
86
        return $this->wrapped ?? false;
87
    }
88
}
89