FlightReservation   A
last analyzed

Complexity

Total Complexity 28

Size/Duplication

Total Lines 438
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 28
lcom 1
cbo 1
dl 438
loc 438
rs 10
c 0
b 0
f 0

28 Methods

Rating   Name   Duplication   Size   Complexity  
A additionalType() 4 4 1
A alternateName() 4 4 1
A bookingAgent() 4 4 1
A bookingTime() 4 4 1
A broker() 4 4 1
A description() 4 4 1
A disambiguatingDescription() 4 4 1
A identifier() 4 4 1
A image() 4 4 1
A mainEntityOfPage() 4 4 1
A modifiedTime() 4 4 1
A name() 4 4 1
A passengerPriorityStatus() 4 4 1
A passengerSequenceNumber() 4 4 1
A potentialAction() 4 4 1
A priceCurrency() 4 4 1
A programMembershipUsed() 4 4 1
A provider() 4 4 1
A reservationFor() 4 4 1
A reservationId() 4 4 1
A reservationStatus() 4 4 1
A reservedTicket() 4 4 1
A sameAs() 4 4 1
A securityScreening() 4 4 1
A subjectOf() 4 4 1
A totalPrice() 4 4 1
A underName() 4 4 1
A url() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace Spatie\SchemaOrg;
4
5
use \Spatie\SchemaOrg\Contracts\FlightReservationContract;
6
use \Spatie\SchemaOrg\Contracts\IntangibleContract;
7
use \Spatie\SchemaOrg\Contracts\ReservationContract;
8
use \Spatie\SchemaOrg\Contracts\ThingContract;
9
10
/**
11
 * A reservation for air travel.
12
 * 
13
 * Note: This type is for information about actual reservations, e.g. in
14
 * confirmation emails or HTML pages with individual confirmations of
15
 * reservations. For offers of tickets, use [[Offer]].
16
 *
17
 * @see http://schema.org/FlightReservation
18
 *
19
 */
20 View Code Duplication
class FlightReservation extends BaseType implements FlightReservationContract, IntangibleContract, ReservationContract, 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...
21
{
22
    /**
23
     * An additional type for the item, typically used for adding more specific
24
     * types from external vocabularies in microdata syntax. This is a
25
     * relationship between something and a class that the thing is in. In RDFa
26
     * syntax, it is better to use the native RDFa syntax - the 'typeof'
27
     * attribute - for multiple types. Schema.org tools may have only weaker
28
     * understanding of extra types, in particular those defined externally.
29
     *
30
     * @param string|string[] $additionalType
31
     *
32
     * @return static
33
     *
34
     * @see http://schema.org/additionalType
35
     */
36
    public function additionalType($additionalType)
37
    {
38
        return $this->setProperty('additionalType', $additionalType);
39
    }
40
41
    /**
42
     * An alias for the item.
43
     *
44
     * @param string|string[] $alternateName
45
     *
46
     * @return static
47
     *
48
     * @see http://schema.org/alternateName
49
     */
50
    public function alternateName($alternateName)
51
    {
52
        return $this->setProperty('alternateName', $alternateName);
53
    }
54
55
    /**
56
     * 'bookingAgent' is an out-dated term indicating a 'broker' that serves as
57
     * a booking agent.
58
     *
59
     * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[]|\Spatie\SchemaOrg\Contracts\PersonContract|\Spatie\SchemaOrg\Contracts\PersonContract[] $bookingAgent
60
     *
61
     * @return static
62
     *
63
     * @see http://schema.org/bookingAgent
64
     */
65
    public function bookingAgent($bookingAgent)
66
    {
67
        return $this->setProperty('bookingAgent', $bookingAgent);
68
    }
69
70
    /**
71
     * The date and time the reservation was booked.
72
     *
73
     * @param \DateTimeInterface|\DateTimeInterface[] $bookingTime
74
     *
75
     * @return static
76
     *
77
     * @see http://schema.org/bookingTime
78
     */
79
    public function bookingTime($bookingTime)
80
    {
81
        return $this->setProperty('bookingTime', $bookingTime);
82
    }
83
84
    /**
85
     * An entity that arranges for an exchange between a buyer and a seller.  In
86
     * most cases a broker never acquires or releases ownership of a product or
87
     * service involved in an exchange.  If it is not clear whether an entity is
88
     * a broker, seller, or buyer, the latter two terms are preferred.
89
     *
90
     * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[]|\Spatie\SchemaOrg\Contracts\PersonContract|\Spatie\SchemaOrg\Contracts\PersonContract[] $broker
91
     *
92
     * @return static
93
     *
94
     * @see http://schema.org/broker
95
     */
96
    public function broker($broker)
97
    {
98
        return $this->setProperty('broker', $broker);
99
    }
100
101
    /**
102
     * A description of the item.
103
     *
104
     * @param string|string[] $description
105
     *
106
     * @return static
107
     *
108
     * @see http://schema.org/description
109
     */
110
    public function description($description)
111
    {
112
        return $this->setProperty('description', $description);
113
    }
114
115
    /**
116
     * A sub property of description. A short description of the item used to
117
     * disambiguate from other, similar items. Information from other properties
118
     * (in particular, name) may be necessary for the description to be useful
119
     * for disambiguation.
120
     *
121
     * @param string|string[] $disambiguatingDescription
122
     *
123
     * @return static
124
     *
125
     * @see http://schema.org/disambiguatingDescription
126
     */
127
    public function disambiguatingDescription($disambiguatingDescription)
128
    {
129
        return $this->setProperty('disambiguatingDescription', $disambiguatingDescription);
130
    }
131
132
    /**
133
     * The identifier property represents any kind of identifier for any kind of
134
     * [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides
135
     * dedicated properties for representing many of these, either as textual
136
     * strings or as URL (URI) links. See [background
137
     * notes](/docs/datamodel.html#identifierBg) for more details.
138
     *
139
     * @param \Spatie\SchemaOrg\Contracts\PropertyValueContract|\Spatie\SchemaOrg\Contracts\PropertyValueContract[]|string|string[] $identifier
140
     *
141
     * @return static
142
     *
143
     * @see http://schema.org/identifier
144
     */
145
    public function identifier($identifier)
146
    {
147
        return $this->setProperty('identifier', $identifier);
148
    }
149
150
    /**
151
     * An image of the item. This can be a [[URL]] or a fully described
152
     * [[ImageObject]].
153
     *
154
     * @param \Spatie\SchemaOrg\Contracts\ImageObjectContract|\Spatie\SchemaOrg\Contracts\ImageObjectContract[]|string|string[] $image
155
     *
156
     * @return static
157
     *
158
     * @see http://schema.org/image
159
     */
160
    public function image($image)
161
    {
162
        return $this->setProperty('image', $image);
163
    }
164
165
    /**
166
     * Indicates a page (or other CreativeWork) for which this thing is the main
167
     * entity being described. See [background
168
     * notes](/docs/datamodel.html#mainEntityBackground) for details.
169
     *
170
     * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|string|string[] $mainEntityOfPage
171
     *
172
     * @return static
173
     *
174
     * @see http://schema.org/mainEntityOfPage
175
     */
176
    public function mainEntityOfPage($mainEntityOfPage)
177
    {
178
        return $this->setProperty('mainEntityOfPage', $mainEntityOfPage);
179
    }
180
181
    /**
182
     * The date and time the reservation was modified.
183
     *
184
     * @param \DateTimeInterface|\DateTimeInterface[] $modifiedTime
185
     *
186
     * @return static
187
     *
188
     * @see http://schema.org/modifiedTime
189
     */
190
    public function modifiedTime($modifiedTime)
191
    {
192
        return $this->setProperty('modifiedTime', $modifiedTime);
193
    }
194
195
    /**
196
     * The name of the item.
197
     *
198
     * @param string|string[] $name
199
     *
200
     * @return static
201
     *
202
     * @see http://schema.org/name
203
     */
204
    public function name($name)
205
    {
206
        return $this->setProperty('name', $name);
207
    }
208
209
    /**
210
     * The priority status assigned to a passenger for security or boarding
211
     * (e.g. FastTrack or Priority).
212
     *
213
     * @param \Spatie\SchemaOrg\Contracts\QualitativeValueContract|\Spatie\SchemaOrg\Contracts\QualitativeValueContract[]|string|string[] $passengerPriorityStatus
214
     *
215
     * @return static
216
     *
217
     * @see http://schema.org/passengerPriorityStatus
218
     */
219
    public function passengerPriorityStatus($passengerPriorityStatus)
220
    {
221
        return $this->setProperty('passengerPriorityStatus', $passengerPriorityStatus);
222
    }
223
224
    /**
225
     * The passenger's sequence number as assigned by the airline.
226
     *
227
     * @param string|string[] $passengerSequenceNumber
228
     *
229
     * @return static
230
     *
231
     * @see http://schema.org/passengerSequenceNumber
232
     */
233
    public function passengerSequenceNumber($passengerSequenceNumber)
234
    {
235
        return $this->setProperty('passengerSequenceNumber', $passengerSequenceNumber);
236
    }
237
238
    /**
239
     * Indicates a potential Action, which describes an idealized action in
240
     * which this thing would play an 'object' role.
241
     *
242
     * @param \Spatie\SchemaOrg\Contracts\ActionContract|\Spatie\SchemaOrg\Contracts\ActionContract[] $potentialAction
243
     *
244
     * @return static
245
     *
246
     * @see http://schema.org/potentialAction
247
     */
248
    public function potentialAction($potentialAction)
249
    {
250
        return $this->setProperty('potentialAction', $potentialAction);
251
    }
252
253
    /**
254
     * The currency of the price, or a price component when attached to
255
     * [[PriceSpecification]] and its subtypes.
256
     * 
257
     * Use standard formats: [ISO 4217 currency
258
     * format](http://en.wikipedia.org/wiki/ISO_4217) e.g. "USD"; [Ticker
259
     * symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for
260
     * cryptocurrencies e.g. "BTC"; well known names for [Local Exchange
261
     * Tradings
262
     * Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system)
263
     * (LETS) and other currency types e.g. "Ithaca HOUR".
264
     *
265
     * @param string|string[] $priceCurrency
266
     *
267
     * @return static
268
     *
269
     * @see http://schema.org/priceCurrency
270
     */
271
    public function priceCurrency($priceCurrency)
272
    {
273
        return $this->setProperty('priceCurrency', $priceCurrency);
274
    }
275
276
    /**
277
     * Any membership in a frequent flyer, hotel loyalty program, etc. being
278
     * applied to the reservation.
279
     *
280
     * @param \Spatie\SchemaOrg\Contracts\ProgramMembershipContract|\Spatie\SchemaOrg\Contracts\ProgramMembershipContract[] $programMembershipUsed
281
     *
282
     * @return static
283
     *
284
     * @see http://schema.org/programMembershipUsed
285
     */
286
    public function programMembershipUsed($programMembershipUsed)
287
    {
288
        return $this->setProperty('programMembershipUsed', $programMembershipUsed);
289
    }
290
291
    /**
292
     * The service provider, service operator, or service performer; the goods
293
     * producer. Another party (a seller) may offer those services or goods on
294
     * behalf of the provider. A provider may also serve as the seller.
295
     *
296
     * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[]|\Spatie\SchemaOrg\Contracts\PersonContract|\Spatie\SchemaOrg\Contracts\PersonContract[] $provider
297
     *
298
     * @return static
299
     *
300
     * @see http://schema.org/provider
301
     */
302
    public function provider($provider)
303
    {
304
        return $this->setProperty('provider', $provider);
305
    }
306
307
    /**
308
     * The thing -- flight, event, restaurant,etc. being reserved.
309
     *
310
     * @param \Spatie\SchemaOrg\Contracts\ThingContract|\Spatie\SchemaOrg\Contracts\ThingContract[] $reservationFor
311
     *
312
     * @return static
313
     *
314
     * @see http://schema.org/reservationFor
315
     */
316
    public function reservationFor($reservationFor)
317
    {
318
        return $this->setProperty('reservationFor', $reservationFor);
319
    }
320
321
    /**
322
     * A unique identifier for the reservation.
323
     *
324
     * @param string|string[] $reservationId
325
     *
326
     * @return static
327
     *
328
     * @see http://schema.org/reservationId
329
     */
330
    public function reservationId($reservationId)
331
    {
332
        return $this->setProperty('reservationId', $reservationId);
333
    }
334
335
    /**
336
     * The current status of the reservation.
337
     *
338
     * @param \Spatie\SchemaOrg\Contracts\ReservationStatusTypeContract|\Spatie\SchemaOrg\Contracts\ReservationStatusTypeContract[] $reservationStatus
339
     *
340
     * @return static
341
     *
342
     * @see http://schema.org/reservationStatus
343
     */
344
    public function reservationStatus($reservationStatus)
345
    {
346
        return $this->setProperty('reservationStatus', $reservationStatus);
347
    }
348
349
    /**
350
     * A ticket associated with the reservation.
351
     *
352
     * @param \Spatie\SchemaOrg\Contracts\TicketContract|\Spatie\SchemaOrg\Contracts\TicketContract[] $reservedTicket
353
     *
354
     * @return static
355
     *
356
     * @see http://schema.org/reservedTicket
357
     */
358
    public function reservedTicket($reservedTicket)
359
    {
360
        return $this->setProperty('reservedTicket', $reservedTicket);
361
    }
362
363
    /**
364
     * URL of a reference Web page that unambiguously indicates the item's
365
     * identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or
366
     * official website.
367
     *
368
     * @param string|string[] $sameAs
369
     *
370
     * @return static
371
     *
372
     * @see http://schema.org/sameAs
373
     */
374
    public function sameAs($sameAs)
375
    {
376
        return $this->setProperty('sameAs', $sameAs);
377
    }
378
379
    /**
380
     * The type of security screening the passenger is subject to.
381
     *
382
     * @param string|string[] $securityScreening
383
     *
384
     * @return static
385
     *
386
     * @see http://schema.org/securityScreening
387
     */
388
    public function securityScreening($securityScreening)
389
    {
390
        return $this->setProperty('securityScreening', $securityScreening);
391
    }
392
393
    /**
394
     * A CreativeWork or Event about this Thing.
395
     *
396
     * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|\Spatie\SchemaOrg\Contracts\EventContract|\Spatie\SchemaOrg\Contracts\EventContract[] $subjectOf
397
     *
398
     * @return static
399
     *
400
     * @see http://schema.org/subjectOf
401
     */
402
    public function subjectOf($subjectOf)
403
    {
404
        return $this->setProperty('subjectOf', $subjectOf);
405
    }
406
407
    /**
408
     * The total price for the reservation or ticket, including applicable
409
     * taxes, shipping, etc.
410
     * 
411
     * Usage guidelines:
412
     * 
413
     * * Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT
414
     * NINE' (U+0039)) rather than superficially similiar Unicode symbols.
415
     * * Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a
416
     * decimal point. Avoid using these symbols as a readability separator.
417
     *
418
     * @param \Spatie\SchemaOrg\Contracts\PriceSpecificationContract|\Spatie\SchemaOrg\Contracts\PriceSpecificationContract[]|float|float[]|int|int[]|string|string[] $totalPrice
419
     *
420
     * @return static
421
     *
422
     * @see http://schema.org/totalPrice
423
     */
424
    public function totalPrice($totalPrice)
425
    {
426
        return $this->setProperty('totalPrice', $totalPrice);
427
    }
428
429
    /**
430
     * The person or organization the reservation or ticket is for.
431
     *
432
     * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[]|\Spatie\SchemaOrg\Contracts\PersonContract|\Spatie\SchemaOrg\Contracts\PersonContract[] $underName
433
     *
434
     * @return static
435
     *
436
     * @see http://schema.org/underName
437
     */
438
    public function underName($underName)
439
    {
440
        return $this->setProperty('underName', $underName);
441
    }
442
443
    /**
444
     * URL of the item.
445
     *
446
     * @param string|string[] $url
447
     *
448
     * @return static
449
     *
450
     * @see http://schema.org/url
451
     */
452
    public function url($url)
453
    {
454
        return $this->setProperty('url', $url);
455
    }
456
457
}
458