CreateEventRequest::shouldValidate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace App\Requests;
4
5
use Illuminate\Support\Collection;
6
use JMS\Serializer\Annotation as JMS;
7
use Realshadow\RequestDeserializer\Contracts\RequestInterface;
8
9
10
class CreateEventRequest implements RequestInterface
11
{
12
13
    /**
14
     * @var string $name
15
     *
16
     * @JMS\Since("1.x")
17
     * @JMS\Type("string")
18
     * @JMS\SerializedName("name")
19
     */
20
    private $name;
21
22
    /**
23
     * @var string|null $description
24
     *
25
     * @JMS\Since("1.x")
26
     * @JMS\Type("string")
27
     * @JMS\SerializedName("description")
28
     */
29
    private $description;
30
31
    /**
32
     * @var \DateTimeImmutable $startsAt
33
     *
34
     * @JMS\Since("1.x")
35
     * @JMS\Type("DateTimeImmutable")
36
     * @JMS\SerializedName("starts_at")
37
     */
38
    private $startsAt;
39
40
    /**
41
     * @var \DateTimeImmutable $endsAt
42
     *
43
     * @JMS\Since("1.x")
44
     * @JMS\Type("DateTimeImmutable")
45
     * @JMS\SerializedName("ends_at")
46
     */
47
    private $endsAt;
48
49
    /**
50
     * @var Collection $attendees
51
     *
52
     * @JMS\Since("1.x")
53
     * @JMS\Type("Illuminate\Support\Collection<App\Requests\AttendeeRequest>")
54
     * @JMS\SerializedName("attendees")
55
     */
56
    protected $attendees;
57
58
59
    /**
60
     * @inheritdoc
61
     */
62
    public static function shouldValidate()
63
    {
64
        return true;
65
    }
66
67
    /**
68
     * @inheritdoc
69
     */
70
    public static function getVersionConstraint()
71
    {
72
        return '1.0';
73
    }
74
75
    /**
76
     * @inheritdoc
77
     */
78
    public function getSchema()
79
    {
80
        return resource_path('schemas/create_event.json');
81
    }
82
83
    /**
84
     * @return string
85
     */
86
    public function getName()
87
    {
88
        return $this->name;
89
    }
90
91
    /**
92
     * @return null|string
93
     */
94
    public function getDescription()
95
    {
96
        return $this->description;
97
    }
98
99
    /**
100
     * @return \DateTimeImmutable
101
     */
102
    public function getStartsAt()
103
    {
104
        return $this->startsAt;
105
    }
106
107
    /**
108
     * @return \DateTimeImmutable
109
     */
110
    public function getEndsAt()
111
    {
112
        return $this->endsAt;
113
    }
114
115
    /**
116
     * @return Collection
117
     */
118
    public function getAttendees()
119
    {
120
        return $this->attendees;
121
    }
122
123
}
124