LocationFeatureSpecification   A
last analyzed

Complexity

Total Complexity 22

Size/Duplication

Total Lines 354
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 22
lcom 1
cbo 1
dl 354
loc 354
rs 10
c 0
b 0
f 0

22 Methods

Rating   Name   Duplication   Size   Complexity  
A additionalType() 4 4 1
A alternateName() 4 4 1
A description() 4 4 1
A disambiguatingDescription() 4 4 1
A hoursAvailable() 4 4 1
A identifier() 4 4 1
A image() 4 4 1
A mainEntityOfPage() 4 4 1
A maxValue() 4 4 1
A minValue() 4 4 1
A name() 4 4 1
A potentialAction() 4 4 1
A propertyID() 4 4 1
A sameAs() 4 4 1
A subjectOf() 4 4 1
A unitCode() 4 4 1
A unitText() 4 4 1
A url() 4 4 1
A validFrom() 4 4 1
A validThrough() 4 4 1
A value() 4 4 1
A valueReference() 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\LocationFeatureSpecificationContract;
6
use \Spatie\SchemaOrg\Contracts\IntangibleContract;
7
use \Spatie\SchemaOrg\Contracts\PropertyValueContract;
8
use \Spatie\SchemaOrg\Contracts\StructuredValueContract;
9
use \Spatie\SchemaOrg\Contracts\ThingContract;
10
11
/**
12
 * Specifies a location feature by providing a structured value representing a
13
 * feature of an accommodation as a property-value pair of varying degrees of
14
 * formality.
15
 *
16
 * @see http://schema.org/LocationFeatureSpecification
17
 *
18
 */
19 View Code Duplication
class LocationFeatureSpecification extends BaseType implements LocationFeatureSpecificationContract, IntangibleContract, PropertyValueContract, 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...
20
{
21
    /**
22
     * An additional type for the item, typically used for adding more specific
23
     * types from external vocabularies in microdata syntax. This is a
24
     * relationship between something and a class that the thing is in. In RDFa
25
     * syntax, it is better to use the native RDFa syntax - the 'typeof'
26
     * attribute - for multiple types. Schema.org tools may have only weaker
27
     * understanding of extra types, in particular those defined externally.
28
     *
29
     * @param string|string[] $additionalType
30
     *
31
     * @return static
32
     *
33
     * @see http://schema.org/additionalType
34
     */
35
    public function additionalType($additionalType)
36
    {
37
        return $this->setProperty('additionalType', $additionalType);
38
    }
39
40
    /**
41
     * An alias for the item.
42
     *
43
     * @param string|string[] $alternateName
44
     *
45
     * @return static
46
     *
47
     * @see http://schema.org/alternateName
48
     */
49
    public function alternateName($alternateName)
50
    {
51
        return $this->setProperty('alternateName', $alternateName);
52
    }
53
54
    /**
55
     * A description of the item.
56
     *
57
     * @param string|string[] $description
58
     *
59
     * @return static
60
     *
61
     * @see http://schema.org/description
62
     */
63
    public function description($description)
64
    {
65
        return $this->setProperty('description', $description);
66
    }
67
68
    /**
69
     * A sub property of description. A short description of the item used to
70
     * disambiguate from other, similar items. Information from other properties
71
     * (in particular, name) may be necessary for the description to be useful
72
     * for disambiguation.
73
     *
74
     * @param string|string[] $disambiguatingDescription
75
     *
76
     * @return static
77
     *
78
     * @see http://schema.org/disambiguatingDescription
79
     */
80
    public function disambiguatingDescription($disambiguatingDescription)
81
    {
82
        return $this->setProperty('disambiguatingDescription', $disambiguatingDescription);
83
    }
84
85
    /**
86
     * The hours during which this service or contact is available.
87
     *
88
     * @param \Spatie\SchemaOrg\Contracts\OpeningHoursSpecificationContract|\Spatie\SchemaOrg\Contracts\OpeningHoursSpecificationContract[] $hoursAvailable
89
     *
90
     * @return static
91
     *
92
     * @see http://schema.org/hoursAvailable
93
     */
94
    public function hoursAvailable($hoursAvailable)
95
    {
96
        return $this->setProperty('hoursAvailable', $hoursAvailable);
97
    }
98
99
    /**
100
     * The identifier property represents any kind of identifier for any kind of
101
     * [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides
102
     * dedicated properties for representing many of these, either as textual
103
     * strings or as URL (URI) links. See [background
104
     * notes](/docs/datamodel.html#identifierBg) for more details.
105
     *
106
     * @param \Spatie\SchemaOrg\Contracts\PropertyValueContract|\Spatie\SchemaOrg\Contracts\PropertyValueContract[]|string|string[] $identifier
107
     *
108
     * @return static
109
     *
110
     * @see http://schema.org/identifier
111
     */
112
    public function identifier($identifier)
113
    {
114
        return $this->setProperty('identifier', $identifier);
115
    }
116
117
    /**
118
     * An image of the item. This can be a [[URL]] or a fully described
119
     * [[ImageObject]].
120
     *
121
     * @param \Spatie\SchemaOrg\Contracts\ImageObjectContract|\Spatie\SchemaOrg\Contracts\ImageObjectContract[]|string|string[] $image
122
     *
123
     * @return static
124
     *
125
     * @see http://schema.org/image
126
     */
127
    public function image($image)
128
    {
129
        return $this->setProperty('image', $image);
130
    }
131
132
    /**
133
     * Indicates a page (or other CreativeWork) for which this thing is the main
134
     * entity being described. See [background
135
     * notes](/docs/datamodel.html#mainEntityBackground) for details.
136
     *
137
     * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|string|string[] $mainEntityOfPage
138
     *
139
     * @return static
140
     *
141
     * @see http://schema.org/mainEntityOfPage
142
     */
143
    public function mainEntityOfPage($mainEntityOfPage)
144
    {
145
        return $this->setProperty('mainEntityOfPage', $mainEntityOfPage);
146
    }
147
148
    /**
149
     * The upper value of some characteristic or property.
150
     *
151
     * @param float|float[]|int|int[] $maxValue
152
     *
153
     * @return static
154
     *
155
     * @see http://schema.org/maxValue
156
     */
157
    public function maxValue($maxValue)
158
    {
159
        return $this->setProperty('maxValue', $maxValue);
160
    }
161
162
    /**
163
     * The lower value of some characteristic or property.
164
     *
165
     * @param float|float[]|int|int[] $minValue
166
     *
167
     * @return static
168
     *
169
     * @see http://schema.org/minValue
170
     */
171
    public function minValue($minValue)
172
    {
173
        return $this->setProperty('minValue', $minValue);
174
    }
175
176
    /**
177
     * The name of the item.
178
     *
179
     * @param string|string[] $name
180
     *
181
     * @return static
182
     *
183
     * @see http://schema.org/name
184
     */
185
    public function name($name)
186
    {
187
        return $this->setProperty('name', $name);
188
    }
189
190
    /**
191
     * Indicates a potential Action, which describes an idealized action in
192
     * which this thing would play an 'object' role.
193
     *
194
     * @param \Spatie\SchemaOrg\Contracts\ActionContract|\Spatie\SchemaOrg\Contracts\ActionContract[] $potentialAction
195
     *
196
     * @return static
197
     *
198
     * @see http://schema.org/potentialAction
199
     */
200
    public function potentialAction($potentialAction)
201
    {
202
        return $this->setProperty('potentialAction', $potentialAction);
203
    }
204
205
    /**
206
     * A commonly used identifier for the characteristic represented by the
207
     * property, e.g. a manufacturer or a standard code for a property.
208
     * propertyID can be
209
     * (1) a prefixed string, mainly meant to be used with standards for product
210
     * properties; (2) a site-specific, non-prefixed string (e.g. the primary
211
     * key of the property or the vendor-specific id of the property), or (3)
212
     * a URL indicating the type of the property, either pointing to an external
213
     * vocabulary, or a Web resource that describes the property (e.g. a
214
     * glossary entry).
215
     * Standards bodies should promote a standard prefix for the identifiers of
216
     * properties from their standards.
217
     *
218
     * @param string|string[] $propertyID
219
     *
220
     * @return static
221
     *
222
     * @see http://schema.org/propertyID
223
     */
224
    public function propertyID($propertyID)
225
    {
226
        return $this->setProperty('propertyID', $propertyID);
227
    }
228
229
    /**
230
     * URL of a reference Web page that unambiguously indicates the item's
231
     * identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or
232
     * official website.
233
     *
234
     * @param string|string[] $sameAs
235
     *
236
     * @return static
237
     *
238
     * @see http://schema.org/sameAs
239
     */
240
    public function sameAs($sameAs)
241
    {
242
        return $this->setProperty('sameAs', $sameAs);
243
    }
244
245
    /**
246
     * A CreativeWork or Event about this Thing.
247
     *
248
     * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|\Spatie\SchemaOrg\Contracts\EventContract|\Spatie\SchemaOrg\Contracts\EventContract[] $subjectOf
249
     *
250
     * @return static
251
     *
252
     * @see http://schema.org/subjectOf
253
     */
254
    public function subjectOf($subjectOf)
255
    {
256
        return $this->setProperty('subjectOf', $subjectOf);
257
    }
258
259
    /**
260
     * The unit of measurement given using the UN/CEFACT Common Code (3
261
     * characters) or a URL. Other codes than the UN/CEFACT Common Code may be
262
     * used with a prefix followed by a colon.
263
     *
264
     * @param string|string[] $unitCode
265
     *
266
     * @return static
267
     *
268
     * @see http://schema.org/unitCode
269
     */
270
    public function unitCode($unitCode)
271
    {
272
        return $this->setProperty('unitCode', $unitCode);
273
    }
274
275
    /**
276
     * A string or text indicating the unit of measurement. Useful if you cannot
277
     * provide a standard unit code for
278
     * <a href='unitCode'>unitCode</a>.
279
     *
280
     * @param string|string[] $unitText
281
     *
282
     * @return static
283
     *
284
     * @see http://schema.org/unitText
285
     */
286
    public function unitText($unitText)
287
    {
288
        return $this->setProperty('unitText', $unitText);
289
    }
290
291
    /**
292
     * URL of the item.
293
     *
294
     * @param string|string[] $url
295
     *
296
     * @return static
297
     *
298
     * @see http://schema.org/url
299
     */
300
    public function url($url)
301
    {
302
        return $this->setProperty('url', $url);
303
    }
304
305
    /**
306
     * The date when the item becomes valid.
307
     *
308
     * @param \DateTimeInterface|\DateTimeInterface[] $validFrom
309
     *
310
     * @return static
311
     *
312
     * @see http://schema.org/validFrom
313
     */
314
    public function validFrom($validFrom)
315
    {
316
        return $this->setProperty('validFrom', $validFrom);
317
    }
318
319
    /**
320
     * The date after when the item is not valid. For example the end of an
321
     * offer, salary period, or a period of opening hours.
322
     *
323
     * @param \DateTimeInterface|\DateTimeInterface[] $validThrough
324
     *
325
     * @return static
326
     *
327
     * @see http://schema.org/validThrough
328
     */
329
    public function validThrough($validThrough)
330
    {
331
        return $this->setProperty('validThrough', $validThrough);
332
    }
333
334
    /**
335
     * The value of the quantitative value or property value node.
336
     * 
337
     * * For [[QuantitativeValue]] and [[MonetaryAmount]], the recommended type
338
     * for values is 'Number'.
339
     * * For [[PropertyValue]], it can be 'Text;', 'Number', 'Boolean', or
340
     * 'StructuredValue'.
341
     * * Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT
342
     * NINE' (U+0039)) rather than superficially similiar Unicode symbols.
343
     * * Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a
344
     * decimal point. Avoid using these symbols as a readability separator.
345
     *
346
     * @param \Spatie\SchemaOrg\Contracts\StructuredValueContract|\Spatie\SchemaOrg\Contracts\StructuredValueContract[]|bool|bool[]|float|float[]|int|int[]|string|string[] $value
347
     *
348
     * @return static
349
     *
350
     * @see http://schema.org/value
351
     */
352
    public function value($value)
353
    {
354
        return $this->setProperty('value', $value);
355
    }
356
357
    /**
358
     * A pointer to a secondary value that provides additional information on
359
     * the original value, e.g. a reference temperature.
360
     *
361
     * @param \Spatie\SchemaOrg\Contracts\EnumerationContract|\Spatie\SchemaOrg\Contracts\EnumerationContract[]|\Spatie\SchemaOrg\Contracts\PropertyValueContract|\Spatie\SchemaOrg\Contracts\PropertyValueContract[]|\Spatie\SchemaOrg\Contracts\QualitativeValueContract|\Spatie\SchemaOrg\Contracts\QualitativeValueContract[]|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract[]|\Spatie\SchemaOrg\Contracts\StructuredValueContract|\Spatie\SchemaOrg\Contracts\StructuredValueContract[] $valueReference
362
     *
363
     * @return static
364
     *
365
     * @see http://schema.org/valueReference
366
     */
367
    public function valueReference($valueReference)
368
    {
369
        return $this->setProperty('valueReference', $valueReference);
370
    }
371
372
}
373