RequestBody::getDescription()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
cc 1
eloc 1
c 1
b 1
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
4
namespace Apie\OpenapiSchema\Spec;
5
6
use Apie\OpenapiSchema\Concerns\CompositeValueObjectWithExtension;
7
use Apie\OpenapiSchema\Map\MediaTypeMap;
8
use Apie\ValueObjects\ValueObjectInterface;
9
10
class RequestBody implements ValueObjectInterface
11
{
12
    use CompositeValueObjectWithExtension;
0 ignored issues
show
Bug introduced by
The trait Apie\OpenapiSchema\Conce...alueObjectWithExtension requires the property $name which is not provided by Apie\OpenapiSchema\Spec\RequestBody.
Loading history...
13
14
    /**
15
     * @var string|null
16
     */
17
    private $description;
18
19
    /**
20
     * @var MediaTypeMap
21
     */
22
    private $content;
23
24
    /**
25
     * @var bool|null
26
     */
27
    private $required = false;
28
29
    public function __construct(MediaTypeMap $content)
30
    {
31
        $this->content = $content;
32
    }
33
34
    /**
35
     * @return string|null
36
     */
37
    public function getDescription(): ?string
38
    {
39
        return $this->description;
40
    }
41
42
    /**
43
     * @return MediaTypeMap
44
     */
45
    public function getContent(): MediaTypeMap
46
    {
47
        return $this->content;
48
    }
49
50
    /**
51
     * @return bool|null
52
     */
53
    public function isRequired(): ?bool
54
    {
55
        return $this->required ?? false;
56
    }
57
}
58