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:
Complex classes like Apartment often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Apartment, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
19 | View Code Duplication | class Apartment extends BaseType implements ApartmentContract, AccommodationContract, PlaceContract, ThingContract |
|
|
|||
20 | { |
||
21 | /** |
||
22 | * A property-value pair representing an additional characteristics of the |
||
23 | * entitity, e.g. a product feature or another characteristic for which |
||
24 | * there is no matching property in schema.org. |
||
25 | * |
||
26 | * Note: Publishers should be aware that applications designed to use |
||
27 | * specific schema.org properties (e.g. http://schema.org/width, |
||
28 | * http://schema.org/color, http://schema.org/gtin13, ...) will typically |
||
29 | * expect such data to be provided using those properties, rather than using |
||
30 | * the generic property/value mechanism. |
||
31 | * |
||
32 | * @param \Spatie\SchemaOrg\Contracts\PropertyValueContract|\Spatie\SchemaOrg\Contracts\PropertyValueContract[] $additionalProperty |
||
33 | * |
||
34 | * @return static |
||
35 | * |
||
36 | * @see http://schema.org/additionalProperty |
||
37 | */ |
||
38 | public function additionalProperty($additionalProperty) |
||
42 | |||
43 | /** |
||
44 | * An additional type for the item, typically used for adding more specific |
||
45 | * types from external vocabularies in microdata syntax. This is a |
||
46 | * relationship between something and a class that the thing is in. In RDFa |
||
47 | * syntax, it is better to use the native RDFa syntax - the 'typeof' |
||
48 | * attribute - for multiple types. Schema.org tools may have only weaker |
||
49 | * understanding of extra types, in particular those defined externally. |
||
50 | * |
||
51 | * @param string|string[] $additionalType |
||
52 | * |
||
53 | * @return static |
||
54 | * |
||
55 | * @see http://schema.org/additionalType |
||
56 | */ |
||
57 | public function additionalType($additionalType) |
||
61 | |||
62 | /** |
||
63 | * Physical address of the item. |
||
64 | * |
||
65 | * @param \Spatie\SchemaOrg\Contracts\PostalAddressContract|\Spatie\SchemaOrg\Contracts\PostalAddressContract[]|string|string[] $address |
||
66 | * |
||
67 | * @return static |
||
68 | * |
||
69 | * @see http://schema.org/address |
||
70 | */ |
||
71 | public function address($address) |
||
75 | |||
76 | /** |
||
77 | * The overall rating, based on a collection of reviews or ratings, of the |
||
78 | * item. |
||
79 | * |
||
80 | * @param \Spatie\SchemaOrg\Contracts\AggregateRatingContract|\Spatie\SchemaOrg\Contracts\AggregateRatingContract[] $aggregateRating |
||
81 | * |
||
82 | * @return static |
||
83 | * |
||
84 | * @see http://schema.org/aggregateRating |
||
85 | */ |
||
86 | public function aggregateRating($aggregateRating) |
||
90 | |||
91 | /** |
||
92 | * An alias for the item. |
||
93 | * |
||
94 | * @param string|string[] $alternateName |
||
95 | * |
||
96 | * @return static |
||
97 | * |
||
98 | * @see http://schema.org/alternateName |
||
99 | */ |
||
100 | public function alternateName($alternateName) |
||
104 | |||
105 | /** |
||
106 | * An amenity feature (e.g. a characteristic or service) of the |
||
107 | * Accommodation. This generic property does not make a statement about |
||
108 | * whether the feature is included in an offer for the main accommodation or |
||
109 | * available at extra costs. |
||
110 | * |
||
111 | * @param \Spatie\SchemaOrg\Contracts\LocationFeatureSpecificationContract|\Spatie\SchemaOrg\Contracts\LocationFeatureSpecificationContract[] $amenityFeature |
||
112 | * |
||
113 | * @return static |
||
114 | * |
||
115 | * @see http://schema.org/amenityFeature |
||
116 | */ |
||
117 | public function amenityFeature($amenityFeature) |
||
121 | |||
122 | /** |
||
123 | * A short textual code (also called "store code") that uniquely identifies |
||
124 | * a place of business. The code is typically assigned by the |
||
125 | * parentOrganization and used in structured URLs. |
||
126 | * |
||
127 | * For example, in the URL |
||
128 | * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" |
||
129 | * is a branchCode for a particular branch. |
||
130 | * |
||
131 | * @param string|string[] $branchCode |
||
132 | * |
||
133 | * @return static |
||
134 | * |
||
135 | * @see http://schema.org/branchCode |
||
136 | */ |
||
137 | public function branchCode($branchCode) |
||
141 | |||
142 | /** |
||
143 | * The basic containment relation between a place and one that contains it. |
||
144 | * |
||
145 | * @param \Spatie\SchemaOrg\Contracts\PlaceContract|\Spatie\SchemaOrg\Contracts\PlaceContract[] $containedIn |
||
146 | * |
||
147 | * @return static |
||
148 | * |
||
149 | * @see http://schema.org/containedIn |
||
150 | */ |
||
151 | public function containedIn($containedIn) |
||
155 | |||
156 | /** |
||
157 | * The basic containment relation between a place and one that contains it. |
||
158 | * |
||
159 | * @param \Spatie\SchemaOrg\Contracts\PlaceContract|\Spatie\SchemaOrg\Contracts\PlaceContract[] $containedInPlace |
||
160 | * |
||
161 | * @return static |
||
162 | * |
||
163 | * @see http://schema.org/containedInPlace |
||
164 | */ |
||
165 | public function containedInPlace($containedInPlace) |
||
169 | |||
170 | /** |
||
171 | * The basic containment relation between a place and another that it |
||
172 | * contains. |
||
173 | * |
||
174 | * @param \Spatie\SchemaOrg\Contracts\PlaceContract|\Spatie\SchemaOrg\Contracts\PlaceContract[] $containsPlace |
||
175 | * |
||
176 | * @return static |
||
177 | * |
||
178 | * @see http://schema.org/containsPlace |
||
179 | */ |
||
180 | public function containsPlace($containsPlace) |
||
184 | |||
185 | /** |
||
186 | * A description of the item. |
||
187 | * |
||
188 | * @param string|string[] $description |
||
189 | * |
||
190 | * @return static |
||
191 | * |
||
192 | * @see http://schema.org/description |
||
193 | */ |
||
194 | public function description($description) |
||
198 | |||
199 | /** |
||
200 | * A sub property of description. A short description of the item used to |
||
201 | * disambiguate from other, similar items. Information from other properties |
||
202 | * (in particular, name) may be necessary for the description to be useful |
||
203 | * for disambiguation. |
||
204 | * |
||
205 | * @param string|string[] $disambiguatingDescription |
||
206 | * |
||
207 | * @return static |
||
208 | * |
||
209 | * @see http://schema.org/disambiguatingDescription |
||
210 | */ |
||
211 | public function disambiguatingDescription($disambiguatingDescription) |
||
215 | |||
216 | /** |
||
217 | * Upcoming or past event associated with this place, organization, or |
||
218 | * action. |
||
219 | * |
||
220 | * @param \Spatie\SchemaOrg\Contracts\EventContract|\Spatie\SchemaOrg\Contracts\EventContract[] $event |
||
221 | * |
||
222 | * @return static |
||
223 | * |
||
224 | * @see http://schema.org/event |
||
225 | */ |
||
226 | public function event($event) |
||
230 | |||
231 | /** |
||
232 | * Upcoming or past events associated with this place or organization. |
||
233 | * |
||
234 | * @param \Spatie\SchemaOrg\Contracts\EventContract|\Spatie\SchemaOrg\Contracts\EventContract[] $events |
||
235 | * |
||
236 | * @return static |
||
237 | * |
||
238 | * @see http://schema.org/events |
||
239 | */ |
||
240 | public function events($events) |
||
244 | |||
245 | /** |
||
246 | * The fax number. |
||
247 | * |
||
248 | * @param string|string[] $faxNumber |
||
249 | * |
||
250 | * @return static |
||
251 | * |
||
252 | * @see http://schema.org/faxNumber |
||
253 | */ |
||
254 | public function faxNumber($faxNumber) |
||
258 | |||
259 | /** |
||
260 | * The size of the accommodation, e.g. in square meter or squarefoot. |
||
261 | * Typical unit code(s): MTK for square meter, FTK for square foot, or YDK |
||
262 | * for square yard |
||
263 | * |
||
264 | * @param \Spatie\SchemaOrg\Contracts\QuantitativeValueContract|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract[] $floorSize |
||
265 | * |
||
266 | * @return static |
||
267 | * |
||
268 | * @see http://schema.org/floorSize |
||
269 | */ |
||
270 | public function floorSize($floorSize) |
||
274 | |||
275 | /** |
||
276 | * The geo coordinates of the place. |
||
277 | * |
||
278 | * @param \Spatie\SchemaOrg\Contracts\GeoCoordinatesContract|\Spatie\SchemaOrg\Contracts\GeoCoordinatesContract[]|\Spatie\SchemaOrg\Contracts\GeoShapeContract|\Spatie\SchemaOrg\Contracts\GeoShapeContract[] $geo |
||
279 | * |
||
280 | * @return static |
||
281 | * |
||
282 | * @see http://schema.org/geo |
||
283 | */ |
||
284 | public function geo($geo) |
||
288 | |||
289 | /** |
||
290 | * The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also |
||
291 | * referred to as International Location Number or ILN) of the respective |
||
292 | * organization, person, or place. The GLN is a 13-digit number used to |
||
293 | * identify parties and physical locations. |
||
294 | * |
||
295 | * @param string|string[] $globalLocationNumber |
||
296 | * |
||
297 | * @return static |
||
298 | * |
||
299 | * @see http://schema.org/globalLocationNumber |
||
300 | */ |
||
301 | public function globalLocationNumber($globalLocationNumber) |
||
305 | |||
306 | /** |
||
307 | * A URL to a map of the place. |
||
308 | * |
||
309 | * @param \Spatie\SchemaOrg\Contracts\MapContract|\Spatie\SchemaOrg\Contracts\MapContract[]|string|string[] $hasMap |
||
310 | * |
||
311 | * @return static |
||
312 | * |
||
313 | * @see http://schema.org/hasMap |
||
314 | */ |
||
315 | public function hasMap($hasMap) |
||
319 | |||
320 | /** |
||
321 | * The identifier property represents any kind of identifier for any kind of |
||
322 | * [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides |
||
323 | * dedicated properties for representing many of these, either as textual |
||
324 | * strings or as URL (URI) links. See [background |
||
325 | * notes](/docs/datamodel.html#identifierBg) for more details. |
||
326 | * |
||
327 | * @param \Spatie\SchemaOrg\Contracts\PropertyValueContract|\Spatie\SchemaOrg\Contracts\PropertyValueContract[]|string|string[] $identifier |
||
328 | * |
||
329 | * @return static |
||
330 | * |
||
331 | * @see http://schema.org/identifier |
||
332 | */ |
||
333 | public function identifier($identifier) |
||
337 | |||
338 | /** |
||
339 | * An image of the item. This can be a [[URL]] or a fully described |
||
340 | * [[ImageObject]]. |
||
341 | * |
||
342 | * @param \Spatie\SchemaOrg\Contracts\ImageObjectContract|\Spatie\SchemaOrg\Contracts\ImageObjectContract[]|string|string[] $image |
||
343 | * |
||
344 | * @return static |
||
345 | * |
||
346 | * @see http://schema.org/image |
||
347 | */ |
||
348 | public function image($image) |
||
352 | |||
353 | /** |
||
354 | * A flag to signal that the item, event, or place is accessible for free. |
||
355 | * |
||
356 | * @param bool|bool[] $isAccessibleForFree |
||
357 | * |
||
358 | * @return static |
||
359 | * |
||
360 | * @see http://schema.org/isAccessibleForFree |
||
361 | */ |
||
362 | public function isAccessibleForFree($isAccessibleForFree) |
||
366 | |||
367 | /** |
||
368 | * The International Standard of Industrial Classification of All Economic |
||
369 | * Activities (ISIC), Revision 4 code for a particular organization, |
||
370 | * business person, or place. |
||
371 | * |
||
372 | * @param string|string[] $isicV4 |
||
373 | * |
||
374 | * @return static |
||
375 | * |
||
376 | * @see http://schema.org/isicV4 |
||
377 | */ |
||
378 | public function isicV4($isicV4) |
||
382 | |||
383 | /** |
||
384 | * The latitude of a location. For example ```37.42242``` ([WGS |
||
385 | * 84](https://en.wikipedia.org/wiki/World_Geodetic_System)). |
||
386 | * |
||
387 | * @param float|float[]|int|int[]|string|string[] $latitude |
||
388 | * |
||
389 | * @return static |
||
390 | * |
||
391 | * @see http://schema.org/latitude |
||
392 | */ |
||
393 | public function latitude($latitude) |
||
397 | |||
398 | /** |
||
399 | * An associated logo. |
||
400 | * |
||
401 | * @param \Spatie\SchemaOrg\Contracts\ImageObjectContract|\Spatie\SchemaOrg\Contracts\ImageObjectContract[]|string|string[] $logo |
||
402 | * |
||
403 | * @return static |
||
404 | * |
||
405 | * @see http://schema.org/logo |
||
406 | */ |
||
407 | public function logo($logo) |
||
411 | |||
412 | /** |
||
413 | * The longitude of a location. For example ```-122.08585``` ([WGS |
||
414 | * 84](https://en.wikipedia.org/wiki/World_Geodetic_System)). |
||
415 | * |
||
416 | * @param float|float[]|int|int[]|string|string[] $longitude |
||
417 | * |
||
418 | * @return static |
||
419 | * |
||
420 | * @see http://schema.org/longitude |
||
421 | */ |
||
422 | public function longitude($longitude) |
||
426 | |||
427 | /** |
||
428 | * Indicates a page (or other CreativeWork) for which this thing is the main |
||
429 | * entity being described. See [background |
||
430 | * notes](/docs/datamodel.html#mainEntityBackground) for details. |
||
431 | * |
||
432 | * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|string|string[] $mainEntityOfPage |
||
433 | * |
||
434 | * @return static |
||
435 | * |
||
436 | * @see http://schema.org/mainEntityOfPage |
||
437 | */ |
||
438 | public function mainEntityOfPage($mainEntityOfPage) |
||
442 | |||
443 | /** |
||
444 | * A URL to a map of the place. |
||
445 | * |
||
446 | * @param string|string[] $map |
||
447 | * |
||
448 | * @return static |
||
449 | * |
||
450 | * @see http://schema.org/map |
||
451 | */ |
||
452 | public function map($map) |
||
456 | |||
457 | /** |
||
458 | * A URL to a map of the place. |
||
459 | * |
||
460 | * @param string|string[] $maps |
||
461 | * |
||
462 | * @return static |
||
463 | * |
||
464 | * @see http://schema.org/maps |
||
465 | */ |
||
466 | public function maps($maps) |
||
470 | |||
471 | /** |
||
472 | * The total number of individuals that may attend an event or venue. |
||
473 | * |
||
474 | * @param int|int[] $maximumAttendeeCapacity |
||
475 | * |
||
476 | * @return static |
||
477 | * |
||
478 | * @see http://schema.org/maximumAttendeeCapacity |
||
479 | */ |
||
480 | public function maximumAttendeeCapacity($maximumAttendeeCapacity) |
||
484 | |||
485 | /** |
||
486 | * The name of the item. |
||
487 | * |
||
488 | * @param string|string[] $name |
||
489 | * |
||
490 | * @return static |
||
491 | * |
||
492 | * @see http://schema.org/name |
||
493 | */ |
||
494 | public function name($name) |
||
498 | |||
499 | /** |
||
500 | * The number of rooms (excluding bathrooms and closets) of the |
||
501 | * accommodation or lodging business. |
||
502 | * Typical unit code(s): ROM for room or C62 for no unit. The type of room |
||
503 | * can be put in the unitText property of the QuantitativeValue. |
||
504 | * |
||
505 | * @param \Spatie\SchemaOrg\Contracts\QuantitativeValueContract|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract[]|float|float[]|int|int[] $numberOfRooms |
||
506 | * |
||
507 | * @return static |
||
508 | * |
||
509 | * @see http://schema.org/numberOfRooms |
||
510 | */ |
||
511 | public function numberOfRooms($numberOfRooms) |
||
515 | |||
516 | /** |
||
517 | * The allowed total occupancy for the accommodation in persons (including |
||
518 | * infants etc). For individual accommodations, this is not necessarily the |
||
519 | * legal maximum but defines the permitted usage as per the contractual |
||
520 | * agreement (e.g. a double room used by a single person). |
||
521 | * Typical unit code(s): C62 for person |
||
522 | * |
||
523 | * @param \Spatie\SchemaOrg\Contracts\QuantitativeValueContract|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract[] $occupancy |
||
524 | * |
||
525 | * @return static |
||
526 | * |
||
527 | * @see http://schema.org/occupancy |
||
528 | */ |
||
529 | public function occupancy($occupancy) |
||
533 | |||
534 | /** |
||
535 | * The opening hours of a certain place. |
||
536 | * |
||
537 | * @param \Spatie\SchemaOrg\Contracts\OpeningHoursSpecificationContract|\Spatie\SchemaOrg\Contracts\OpeningHoursSpecificationContract[] $openingHoursSpecification |
||
538 | * |
||
539 | * @return static |
||
540 | * |
||
541 | * @see http://schema.org/openingHoursSpecification |
||
542 | */ |
||
543 | public function openingHoursSpecification($openingHoursSpecification) |
||
547 | |||
548 | /** |
||
549 | * Indications regarding the permitted usage of the accommodation. |
||
550 | * |
||
551 | * @param string|string[] $permittedUsage |
||
552 | * |
||
553 | * @return static |
||
554 | * |
||
555 | * @see http://schema.org/permittedUsage |
||
556 | */ |
||
557 | public function permittedUsage($permittedUsage) |
||
561 | |||
562 | /** |
||
563 | * Indicates whether pets are allowed to enter the accommodation or lodging |
||
564 | * business. More detailed information can be put in a text value. |
||
565 | * |
||
566 | * @param bool|bool[]|string|string[] $petsAllowed |
||
567 | * |
||
568 | * @return static |
||
569 | * |
||
570 | * @see http://schema.org/petsAllowed |
||
571 | */ |
||
572 | public function petsAllowed($petsAllowed) |
||
576 | |||
577 | /** |
||
578 | * A photograph of this place. |
||
579 | * |
||
580 | * @param \Spatie\SchemaOrg\Contracts\ImageObjectContract|\Spatie\SchemaOrg\Contracts\ImageObjectContract[]|\Spatie\SchemaOrg\Contracts\PhotographContract|\Spatie\SchemaOrg\Contracts\PhotographContract[] $photo |
||
581 | * |
||
582 | * @return static |
||
583 | * |
||
584 | * @see http://schema.org/photo |
||
585 | */ |
||
586 | public function photo($photo) |
||
590 | |||
591 | /** |
||
592 | * Photographs of this place. |
||
593 | * |
||
594 | * @param \Spatie\SchemaOrg\Contracts\ImageObjectContract|\Spatie\SchemaOrg\Contracts\ImageObjectContract[]|\Spatie\SchemaOrg\Contracts\PhotographContract|\Spatie\SchemaOrg\Contracts\PhotographContract[] $photos |
||
595 | * |
||
596 | * @return static |
||
597 | * |
||
598 | * @see http://schema.org/photos |
||
599 | */ |
||
600 | public function photos($photos) |
||
604 | |||
605 | /** |
||
606 | * Indicates a potential Action, which describes an idealized action in |
||
607 | * which this thing would play an 'object' role. |
||
608 | * |
||
609 | * @param \Spatie\SchemaOrg\Contracts\ActionContract|\Spatie\SchemaOrg\Contracts\ActionContract[] $potentialAction |
||
610 | * |
||
611 | * @return static |
||
612 | * |
||
613 | * @see http://schema.org/potentialAction |
||
614 | */ |
||
615 | public function potentialAction($potentialAction) |
||
619 | |||
620 | /** |
||
621 | * A flag to signal that the [[Place]] is open to public visitors. If this |
||
622 | * property is omitted there is no assumed default boolean value |
||
623 | * |
||
624 | * @param bool|bool[] $publicAccess |
||
625 | * |
||
626 | * @return static |
||
627 | * |
||
628 | * @see http://schema.org/publicAccess |
||
629 | */ |
||
630 | public function publicAccess($publicAccess) |
||
634 | |||
635 | /** |
||
636 | * A review of the item. |
||
637 | * |
||
638 | * @param \Spatie\SchemaOrg\Contracts\ReviewContract|\Spatie\SchemaOrg\Contracts\ReviewContract[] $review |
||
639 | * |
||
640 | * @return static |
||
641 | * |
||
642 | * @see http://schema.org/review |
||
643 | */ |
||
644 | public function review($review) |
||
648 | |||
649 | /** |
||
650 | * Review of the item. |
||
651 | * |
||
652 | * @param \Spatie\SchemaOrg\Contracts\ReviewContract|\Spatie\SchemaOrg\Contracts\ReviewContract[] $reviews |
||
653 | * |
||
654 | * @return static |
||
655 | * |
||
656 | * @see http://schema.org/reviews |
||
657 | */ |
||
658 | public function reviews($reviews) |
||
662 | |||
663 | /** |
||
664 | * URL of a reference Web page that unambiguously indicates the item's |
||
665 | * identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or |
||
666 | * official website. |
||
667 | * |
||
668 | * @param string|string[] $sameAs |
||
669 | * |
||
670 | * @return static |
||
671 | * |
||
672 | * @see http://schema.org/sameAs |
||
673 | */ |
||
674 | public function sameAs($sameAs) |
||
678 | |||
679 | /** |
||
680 | * A slogan or motto associated with the item. |
||
681 | * |
||
682 | * @param string|string[] $slogan |
||
683 | * |
||
684 | * @return static |
||
685 | * |
||
686 | * @see http://schema.org/slogan |
||
687 | */ |
||
688 | public function slogan($slogan) |
||
692 | |||
693 | /** |
||
694 | * Indicates whether it is allowed to smoke in the place, e.g. in the |
||
695 | * restaurant, hotel or hotel room. |
||
696 | * |
||
697 | * @param bool|bool[] $smokingAllowed |
||
698 | * |
||
699 | * @return static |
||
700 | * |
||
701 | * @see http://schema.org/smokingAllowed |
||
702 | */ |
||
703 | public function smokingAllowed($smokingAllowed) |
||
707 | |||
708 | /** |
||
709 | * The special opening hours of a certain place. |
||
710 | * |
||
711 | * Use this to explicitly override general opening hours brought in scope by |
||
712 | * [[openingHoursSpecification]] or [[openingHours]]. |
||
713 | * |
||
714 | * @param \Spatie\SchemaOrg\Contracts\OpeningHoursSpecificationContract|\Spatie\SchemaOrg\Contracts\OpeningHoursSpecificationContract[] $specialOpeningHoursSpecification |
||
715 | * |
||
716 | * @return static |
||
717 | * |
||
718 | * @see http://schema.org/specialOpeningHoursSpecification |
||
719 | */ |
||
720 | public function specialOpeningHoursSpecification($specialOpeningHoursSpecification) |
||
724 | |||
725 | /** |
||
726 | * A CreativeWork or Event about this Thing. |
||
727 | * |
||
728 | * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|\Spatie\SchemaOrg\Contracts\EventContract|\Spatie\SchemaOrg\Contracts\EventContract[] $subjectOf |
||
729 | * |
||
730 | * @return static |
||
731 | * |
||
732 | * @see http://schema.org/subjectOf |
||
733 | */ |
||
734 | public function subjectOf($subjectOf) |
||
738 | |||
739 | /** |
||
740 | * The telephone number. |
||
741 | * |
||
742 | * @param string|string[] $telephone |
||
743 | * |
||
744 | * @return static |
||
745 | * |
||
746 | * @see http://schema.org/telephone |
||
747 | */ |
||
748 | public function telephone($telephone) |
||
752 | |||
753 | /** |
||
754 | * URL of the item. |
||
755 | * |
||
756 | * @param string|string[] $url |
||
757 | * |
||
758 | * @return static |
||
759 | * |
||
760 | * @see http://schema.org/url |
||
761 | */ |
||
762 | public function url($url) |
||
766 | |||
767 | } |
||
768 |
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.