Xml::isAttribute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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