OpeningHoursSpecification::description()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Spatie\SchemaOrg;
4
5
use \Spatie\SchemaOrg\Contracts\OpeningHoursSpecificationContract;
6
use \Spatie\SchemaOrg\Contracts\IntangibleContract;
7
use \Spatie\SchemaOrg\Contracts\StructuredValueContract;
8
use \Spatie\SchemaOrg\Contracts\ThingContract;
9
10
/**
11
 * A structured value providing information about the opening hours of a place
12
 * or a certain service inside a place.
13
 * 
14
 * 
15
 * The place is __open__ if the [[opens]] property is specified, and __closed__
16
 * otherwise.
17
 * 
18
 * If the value for the [[closes]] property is less than the value for the
19
 * [[opens]] property then the hour range is assumed to span over the next day.
20
 *
21
 * @see http://schema.org/OpeningHoursSpecification
22
 *
23
 */
24 View Code Duplication
class OpeningHoursSpecification extends BaseType implements OpeningHoursSpecificationContract, IntangibleContract, StructuredValueContract, ThingContract
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
{
26
    /**
27
     * An additional type for the item, typically used for adding more specific
28
     * types from external vocabularies in microdata syntax. This is a
29
     * relationship between something and a class that the thing is in. In RDFa
30
     * syntax, it is better to use the native RDFa syntax - the 'typeof'
31
     * attribute - for multiple types. Schema.org tools may have only weaker
32
     * understanding of extra types, in particular those defined externally.
33
     *
34
     * @param string|string[] $additionalType
35
     *
36
     * @return static
37
     *
38
     * @see http://schema.org/additionalType
39
     */
40
    public function additionalType($additionalType)
41
    {
42
        return $this->setProperty('additionalType', $additionalType);
43
    }
44
45
    /**
46
     * An alias for the item.
47
     *
48
     * @param string|string[] $alternateName
49
     *
50
     * @return static
51
     *
52
     * @see http://schema.org/alternateName
53
     */
54
    public function alternateName($alternateName)
55
    {
56
        return $this->setProperty('alternateName', $alternateName);
57
    }
58
59
    /**
60
     * The closing hour of the place or service on the given day(s) of the week.
61
     *
62
     * @param \DateTimeInterface|\DateTimeInterface[] $closes
63
     *
64
     * @return static
65
     *
66
     * @see http://schema.org/closes
67
     */
68
    public function closes($closes)
69
    {
70
        return $this->setProperty('closes', $closes);
71
    }
72
73
    /**
74
     * The day of the week for which these opening hours are valid.
75
     *
76
     * @param \Spatie\SchemaOrg\Contracts\DayOfWeekContract|\Spatie\SchemaOrg\Contracts\DayOfWeekContract[] $dayOfWeek
77
     *
78
     * @return static
79
     *
80
     * @see http://schema.org/dayOfWeek
81
     */
82
    public function dayOfWeek($dayOfWeek)
83
    {
84
        return $this->setProperty('dayOfWeek', $dayOfWeek);
85
    }
86
87
    /**
88
     * A description of the item.
89
     *
90
     * @param string|string[] $description
91
     *
92
     * @return static
93
     *
94
     * @see http://schema.org/description
95
     */
96
    public function description($description)
97
    {
98
        return $this->setProperty('description', $description);
99
    }
100
101
    /**
102
     * A sub property of description. A short description of the item used to
103
     * disambiguate from other, similar items. Information from other properties
104
     * (in particular, name) may be necessary for the description to be useful
105
     * for disambiguation.
106
     *
107
     * @param string|string[] $disambiguatingDescription
108
     *
109
     * @return static
110
     *
111
     * @see http://schema.org/disambiguatingDescription
112
     */
113
    public function disambiguatingDescription($disambiguatingDescription)
114
    {
115
        return $this->setProperty('disambiguatingDescription', $disambiguatingDescription);
116
    }
117
118
    /**
119
     * The identifier property represents any kind of identifier for any kind of
120
     * [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides
121
     * dedicated properties for representing many of these, either as textual
122
     * strings or as URL (URI) links. See [background
123
     * notes](/docs/datamodel.html#identifierBg) for more details.
124
     *
125
     * @param \Spatie\SchemaOrg\Contracts\PropertyValueContract|\Spatie\SchemaOrg\Contracts\PropertyValueContract[]|string|string[] $identifier
126
     *
127
     * @return static
128
     *
129
     * @see http://schema.org/identifier
130
     */
131
    public function identifier($identifier)
132
    {
133
        return $this->setProperty('identifier', $identifier);
134
    }
135
136
    /**
137
     * An image of the item. This can be a [[URL]] or a fully described
138
     * [[ImageObject]].
139
     *
140
     * @param \Spatie\SchemaOrg\Contracts\ImageObjectContract|\Spatie\SchemaOrg\Contracts\ImageObjectContract[]|string|string[] $image
141
     *
142
     * @return static
143
     *
144
     * @see http://schema.org/image
145
     */
146
    public function image($image)
147
    {
148
        return $this->setProperty('image', $image);
149
    }
150
151
    /**
152
     * Indicates a page (or other CreativeWork) for which this thing is the main
153
     * entity being described. See [background
154
     * notes](/docs/datamodel.html#mainEntityBackground) for details.
155
     *
156
     * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|string|string[] $mainEntityOfPage
157
     *
158
     * @return static
159
     *
160
     * @see http://schema.org/mainEntityOfPage
161
     */
162
    public function mainEntityOfPage($mainEntityOfPage)
163
    {
164
        return $this->setProperty('mainEntityOfPage', $mainEntityOfPage);
165
    }
166
167
    /**
168
     * The name of the item.
169
     *
170
     * @param string|string[] $name
171
     *
172
     * @return static
173
     *
174
     * @see http://schema.org/name
175
     */
176
    public function name($name)
177
    {
178
        return $this->setProperty('name', $name);
179
    }
180
181
    /**
182
     * The opening hour of the place or service on the given day(s) of the week.
183
     *
184
     * @param \DateTimeInterface|\DateTimeInterface[] $opens
185
     *
186
     * @return static
187
     *
188
     * @see http://schema.org/opens
189
     */
190
    public function opens($opens)
191
    {
192
        return $this->setProperty('opens', $opens);
193
    }
194
195
    /**
196
     * Indicates a potential Action, which describes an idealized action in
197
     * which this thing would play an 'object' role.
198
     *
199
     * @param \Spatie\SchemaOrg\Contracts\ActionContract|\Spatie\SchemaOrg\Contracts\ActionContract[] $potentialAction
200
     *
201
     * @return static
202
     *
203
     * @see http://schema.org/potentialAction
204
     */
205
    public function potentialAction($potentialAction)
206
    {
207
        return $this->setProperty('potentialAction', $potentialAction);
208
    }
209
210
    /**
211
     * URL of a reference Web page that unambiguously indicates the item's
212
     * identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or
213
     * official website.
214
     *
215
     * @param string|string[] $sameAs
216
     *
217
     * @return static
218
     *
219
     * @see http://schema.org/sameAs
220
     */
221
    public function sameAs($sameAs)
222
    {
223
        return $this->setProperty('sameAs', $sameAs);
224
    }
225
226
    /**
227
     * A CreativeWork or Event about this Thing.
228
     *
229
     * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|\Spatie\SchemaOrg\Contracts\EventContract|\Spatie\SchemaOrg\Contracts\EventContract[] $subjectOf
230
     *
231
     * @return static
232
     *
233
     * @see http://schema.org/subjectOf
234
     */
235
    public function subjectOf($subjectOf)
236
    {
237
        return $this->setProperty('subjectOf', $subjectOf);
238
    }
239
240
    /**
241
     * URL of the item.
242
     *
243
     * @param string|string[] $url
244
     *
245
     * @return static
246
     *
247
     * @see http://schema.org/url
248
     */
249
    public function url($url)
250
    {
251
        return $this->setProperty('url', $url);
252
    }
253
254
    /**
255
     * The date when the item becomes valid.
256
     *
257
     * @param \DateTimeInterface|\DateTimeInterface[] $validFrom
258
     *
259
     * @return static
260
     *
261
     * @see http://schema.org/validFrom
262
     */
263
    public function validFrom($validFrom)
264
    {
265
        return $this->setProperty('validFrom', $validFrom);
266
    }
267
268
    /**
269
     * The date after when the item is not valid. For example the end of an
270
     * offer, salary period, or a period of opening hours.
271
     *
272
     * @param \DateTimeInterface|\DateTimeInterface[] $validThrough
273
     *
274
     * @return static
275
     *
276
     * @see http://schema.org/validThrough
277
     */
278
    public function validThrough($validThrough)
279
    {
280
        return $this->setProperty('validThrough', $validThrough);
281
    }
282
283
}
284