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 WorkersUnion 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 WorkersUnion, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
17 | View Code Duplication | class WorkersUnion extends BaseType implements WorkersUnionContract, OrganizationContract, ThingContract |
|
|
|||
18 | { |
||
19 | /** |
||
20 | * An additional type for the item, typically used for adding more specific |
||
21 | * types from external vocabularies in microdata syntax. This is a |
||
22 | * relationship between something and a class that the thing is in. In RDFa |
||
23 | * syntax, it is better to use the native RDFa syntax - the 'typeof' |
||
24 | * attribute - for multiple types. Schema.org tools may have only weaker |
||
25 | * understanding of extra types, in particular those defined externally. |
||
26 | * |
||
27 | * @param string|string[] $additionalType |
||
28 | * |
||
29 | * @return static |
||
30 | * |
||
31 | * @see http://schema.org/additionalType |
||
32 | */ |
||
33 | public function additionalType($additionalType) |
||
37 | |||
38 | /** |
||
39 | * Physical address of the item. |
||
40 | * |
||
41 | * @param \Spatie\SchemaOrg\Contracts\PostalAddressContract|\Spatie\SchemaOrg\Contracts\PostalAddressContract[]|string|string[] $address |
||
42 | * |
||
43 | * @return static |
||
44 | * |
||
45 | * @see http://schema.org/address |
||
46 | */ |
||
47 | public function address($address) |
||
51 | |||
52 | /** |
||
53 | * The overall rating, based on a collection of reviews or ratings, of the |
||
54 | * item. |
||
55 | * |
||
56 | * @param \Spatie\SchemaOrg\Contracts\AggregateRatingContract|\Spatie\SchemaOrg\Contracts\AggregateRatingContract[] $aggregateRating |
||
57 | * |
||
58 | * @return static |
||
59 | * |
||
60 | * @see http://schema.org/aggregateRating |
||
61 | */ |
||
62 | public function aggregateRating($aggregateRating) |
||
66 | |||
67 | /** |
||
68 | * An alias for the item. |
||
69 | * |
||
70 | * @param string|string[] $alternateName |
||
71 | * |
||
72 | * @return static |
||
73 | * |
||
74 | * @see http://schema.org/alternateName |
||
75 | */ |
||
76 | public function alternateName($alternateName) |
||
80 | |||
81 | /** |
||
82 | * The geographic area where a service or offered item is provided. |
||
83 | * |
||
84 | * @param \Spatie\SchemaOrg\Contracts\AdministrativeAreaContract|\Spatie\SchemaOrg\Contracts\AdministrativeAreaContract[]|\Spatie\SchemaOrg\Contracts\GeoShapeContract|\Spatie\SchemaOrg\Contracts\GeoShapeContract[]|\Spatie\SchemaOrg\Contracts\PlaceContract|\Spatie\SchemaOrg\Contracts\PlaceContract[]|string|string[] $areaServed |
||
85 | * |
||
86 | * @return static |
||
87 | * |
||
88 | * @see http://schema.org/areaServed |
||
89 | */ |
||
90 | public function areaServed($areaServed) |
||
94 | |||
95 | /** |
||
96 | * An award won by or for this item. |
||
97 | * |
||
98 | * @param string|string[] $award |
||
99 | * |
||
100 | * @return static |
||
101 | * |
||
102 | * @see http://schema.org/award |
||
103 | */ |
||
104 | public function award($award) |
||
108 | |||
109 | /** |
||
110 | * Awards won by or for this item. |
||
111 | * |
||
112 | * @param string|string[] $awards |
||
113 | * |
||
114 | * @return static |
||
115 | * |
||
116 | * @see http://schema.org/awards |
||
117 | */ |
||
118 | public function awards($awards) |
||
122 | |||
123 | /** |
||
124 | * The brand(s) associated with a product or service, or the brand(s) |
||
125 | * maintained by an organization or business person. |
||
126 | * |
||
127 | * @param \Spatie\SchemaOrg\Contracts\BrandContract|\Spatie\SchemaOrg\Contracts\BrandContract[]|\Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[] $brand |
||
128 | * |
||
129 | * @return static |
||
130 | * |
||
131 | * @see http://schema.org/brand |
||
132 | */ |
||
133 | public function brand($brand) |
||
137 | |||
138 | /** |
||
139 | * A contact point for a person or organization. |
||
140 | * |
||
141 | * @param \Spatie\SchemaOrg\Contracts\ContactPointContract|\Spatie\SchemaOrg\Contracts\ContactPointContract[] $contactPoint |
||
142 | * |
||
143 | * @return static |
||
144 | * |
||
145 | * @see http://schema.org/contactPoint |
||
146 | */ |
||
147 | public function contactPoint($contactPoint) |
||
151 | |||
152 | /** |
||
153 | * A contact point for a person or organization. |
||
154 | * |
||
155 | * @param \Spatie\SchemaOrg\Contracts\ContactPointContract|\Spatie\SchemaOrg\Contracts\ContactPointContract[] $contactPoints |
||
156 | * |
||
157 | * @return static |
||
158 | * |
||
159 | * @see http://schema.org/contactPoints |
||
160 | */ |
||
161 | public function contactPoints($contactPoints) |
||
165 | |||
166 | /** |
||
167 | * A relationship between an organization and a department of that |
||
168 | * organization, also described as an organization (allowing different urls, |
||
169 | * logos, opening hours). For example: a store with a pharmacy, or a bakery |
||
170 | * with a cafe. |
||
171 | * |
||
172 | * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[] $department |
||
173 | * |
||
174 | * @return static |
||
175 | * |
||
176 | * @see http://schema.org/department |
||
177 | */ |
||
178 | public function department($department) |
||
182 | |||
183 | /** |
||
184 | * A description of the item. |
||
185 | * |
||
186 | * @param string|string[] $description |
||
187 | * |
||
188 | * @return static |
||
189 | * |
||
190 | * @see http://schema.org/description |
||
191 | */ |
||
192 | public function description($description) |
||
196 | |||
197 | /** |
||
198 | * A sub property of description. A short description of the item used to |
||
199 | * disambiguate from other, similar items. Information from other properties |
||
200 | * (in particular, name) may be necessary for the description to be useful |
||
201 | * for disambiguation. |
||
202 | * |
||
203 | * @param string|string[] $disambiguatingDescription |
||
204 | * |
||
205 | * @return static |
||
206 | * |
||
207 | * @see http://schema.org/disambiguatingDescription |
||
208 | */ |
||
209 | public function disambiguatingDescription($disambiguatingDescription) |
||
213 | |||
214 | /** |
||
215 | * The date that this organization was dissolved. |
||
216 | * |
||
217 | * @param \DateTimeInterface|\DateTimeInterface[] $dissolutionDate |
||
218 | * |
||
219 | * @return static |
||
220 | * |
||
221 | * @see http://schema.org/dissolutionDate |
||
222 | */ |
||
223 | public function dissolutionDate($dissolutionDate) |
||
227 | |||
228 | /** |
||
229 | * The Dun & Bradstreet DUNS number for identifying an organization or |
||
230 | * business person. |
||
231 | * |
||
232 | * @param string|string[] $duns |
||
233 | * |
||
234 | * @return static |
||
235 | * |
||
236 | * @see http://schema.org/duns |
||
237 | */ |
||
238 | public function duns($duns) |
||
242 | |||
243 | /** |
||
244 | * Email address. |
||
245 | * |
||
246 | * @param string|string[] $email |
||
247 | * |
||
248 | * @return static |
||
249 | * |
||
250 | * @see http://schema.org/email |
||
251 | */ |
||
252 | public function email($email) |
||
256 | |||
257 | /** |
||
258 | * Someone working for this organization. |
||
259 | * |
||
260 | * @param \Spatie\SchemaOrg\Contracts\PersonContract|\Spatie\SchemaOrg\Contracts\PersonContract[] $employee |
||
261 | * |
||
262 | * @return static |
||
263 | * |
||
264 | * @see http://schema.org/employee |
||
265 | */ |
||
266 | public function employee($employee) |
||
270 | |||
271 | /** |
||
272 | * People working for this organization. |
||
273 | * |
||
274 | * @param \Spatie\SchemaOrg\Contracts\PersonContract|\Spatie\SchemaOrg\Contracts\PersonContract[] $employees |
||
275 | * |
||
276 | * @return static |
||
277 | * |
||
278 | * @see http://schema.org/employees |
||
279 | */ |
||
280 | public function employees($employees) |
||
284 | |||
285 | /** |
||
286 | * Upcoming or past event associated with this place, organization, or |
||
287 | * action. |
||
288 | * |
||
289 | * @param \Spatie\SchemaOrg\Contracts\EventContract|\Spatie\SchemaOrg\Contracts\EventContract[] $event |
||
290 | * |
||
291 | * @return static |
||
292 | * |
||
293 | * @see http://schema.org/event |
||
294 | */ |
||
295 | public function event($event) |
||
299 | |||
300 | /** |
||
301 | * Upcoming or past events associated with this place or organization. |
||
302 | * |
||
303 | * @param \Spatie\SchemaOrg\Contracts\EventContract|\Spatie\SchemaOrg\Contracts\EventContract[] $events |
||
304 | * |
||
305 | * @return static |
||
306 | * |
||
307 | * @see http://schema.org/events |
||
308 | */ |
||
309 | public function events($events) |
||
313 | |||
314 | /** |
||
315 | * The fax number. |
||
316 | * |
||
317 | * @param string|string[] $faxNumber |
||
318 | * |
||
319 | * @return static |
||
320 | * |
||
321 | * @see http://schema.org/faxNumber |
||
322 | */ |
||
323 | public function faxNumber($faxNumber) |
||
327 | |||
328 | /** |
||
329 | * A person who founded this organization. |
||
330 | * |
||
331 | * @param \Spatie\SchemaOrg\Contracts\PersonContract|\Spatie\SchemaOrg\Contracts\PersonContract[] $founder |
||
332 | * |
||
333 | * @return static |
||
334 | * |
||
335 | * @see http://schema.org/founder |
||
336 | */ |
||
337 | public function founder($founder) |
||
341 | |||
342 | /** |
||
343 | * A person who founded this organization. |
||
344 | * |
||
345 | * @param \Spatie\SchemaOrg\Contracts\PersonContract|\Spatie\SchemaOrg\Contracts\PersonContract[] $founders |
||
346 | * |
||
347 | * @return static |
||
348 | * |
||
349 | * @see http://schema.org/founders |
||
350 | */ |
||
351 | public function founders($founders) |
||
355 | |||
356 | /** |
||
357 | * The date that this organization was founded. |
||
358 | * |
||
359 | * @param \DateTimeInterface|\DateTimeInterface[] $foundingDate |
||
360 | * |
||
361 | * @return static |
||
362 | * |
||
363 | * @see http://schema.org/foundingDate |
||
364 | */ |
||
365 | public function foundingDate($foundingDate) |
||
369 | |||
370 | /** |
||
371 | * The place where the Organization was founded. |
||
372 | * |
||
373 | * @param \Spatie\SchemaOrg\Contracts\PlaceContract|\Spatie\SchemaOrg\Contracts\PlaceContract[] $foundingLocation |
||
374 | * |
||
375 | * @return static |
||
376 | * |
||
377 | * @see http://schema.org/foundingLocation |
||
378 | */ |
||
379 | public function foundingLocation($foundingLocation) |
||
383 | |||
384 | /** |
||
385 | * A person or organization that supports (sponsors) something through some |
||
386 | * kind of financial contribution. |
||
387 | * |
||
388 | * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[]|\Spatie\SchemaOrg\Contracts\PersonContract|\Spatie\SchemaOrg\Contracts\PersonContract[] $funder |
||
389 | * |
||
390 | * @return static |
||
391 | * |
||
392 | * @see http://schema.org/funder |
||
393 | */ |
||
394 | public function funder($funder) |
||
398 | |||
399 | /** |
||
400 | * The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also |
||
401 | * referred to as International Location Number or ILN) of the respective |
||
402 | * organization, person, or place. The GLN is a 13-digit number used to |
||
403 | * identify parties and physical locations. |
||
404 | * |
||
405 | * @param string|string[] $globalLocationNumber |
||
406 | * |
||
407 | * @return static |
||
408 | * |
||
409 | * @see http://schema.org/globalLocationNumber |
||
410 | */ |
||
411 | public function globalLocationNumber($globalLocationNumber) |
||
415 | |||
416 | /** |
||
417 | * Indicates an OfferCatalog listing for this Organization, Person, or |
||
418 | * Service. |
||
419 | * |
||
420 | * @param \Spatie\SchemaOrg\Contracts\OfferCatalogContract|\Spatie\SchemaOrg\Contracts\OfferCatalogContract[] $hasOfferCatalog |
||
421 | * |
||
422 | * @return static |
||
423 | * |
||
424 | * @see http://schema.org/hasOfferCatalog |
||
425 | */ |
||
426 | public function hasOfferCatalog($hasOfferCatalog) |
||
430 | |||
431 | /** |
||
432 | * Points-of-Sales operated by the organization or person. |
||
433 | * |
||
434 | * @param \Spatie\SchemaOrg\Contracts\PlaceContract|\Spatie\SchemaOrg\Contracts\PlaceContract[] $hasPOS |
||
435 | * |
||
436 | * @return static |
||
437 | * |
||
438 | * @see http://schema.org/hasPOS |
||
439 | */ |
||
440 | public function hasPOS($hasPOS) |
||
444 | |||
445 | /** |
||
446 | * The identifier property represents any kind of identifier for any kind of |
||
447 | * [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides |
||
448 | * dedicated properties for representing many of these, either as textual |
||
449 | * strings or as URL (URI) links. See [background |
||
450 | * notes](/docs/datamodel.html#identifierBg) for more details. |
||
451 | * |
||
452 | * @param \Spatie\SchemaOrg\Contracts\PropertyValueContract|\Spatie\SchemaOrg\Contracts\PropertyValueContract[]|string|string[] $identifier |
||
453 | * |
||
454 | * @return static |
||
455 | * |
||
456 | * @see http://schema.org/identifier |
||
457 | */ |
||
458 | public function identifier($identifier) |
||
462 | |||
463 | /** |
||
464 | * An image of the item. This can be a [[URL]] or a fully described |
||
465 | * [[ImageObject]]. |
||
466 | * |
||
467 | * @param \Spatie\SchemaOrg\Contracts\ImageObjectContract|\Spatie\SchemaOrg\Contracts\ImageObjectContract[]|string|string[] $image |
||
468 | * |
||
469 | * @return static |
||
470 | * |
||
471 | * @see http://schema.org/image |
||
472 | */ |
||
473 | public function image($image) |
||
477 | |||
478 | /** |
||
479 | * The International Standard of Industrial Classification of All Economic |
||
480 | * Activities (ISIC), Revision 4 code for a particular organization, |
||
481 | * business person, or place. |
||
482 | * |
||
483 | * @param string|string[] $isicV4 |
||
484 | * |
||
485 | * @return static |
||
486 | * |
||
487 | * @see http://schema.org/isicV4 |
||
488 | */ |
||
489 | public function isicV4($isicV4) |
||
493 | |||
494 | /** |
||
495 | * The official name of the organization, e.g. the registered company name. |
||
496 | * |
||
497 | * @param string|string[] $legalName |
||
498 | * |
||
499 | * @return static |
||
500 | * |
||
501 | * @see http://schema.org/legalName |
||
502 | */ |
||
503 | public function legalName($legalName) |
||
507 | |||
508 | /** |
||
509 | * An organization identifier that uniquely identifies a legal entity as |
||
510 | * defined in ISO 17442. |
||
511 | * |
||
512 | * @param string|string[] $leiCode |
||
513 | * |
||
514 | * @return static |
||
515 | * |
||
516 | * @see http://schema.org/leiCode |
||
517 | */ |
||
518 | public function leiCode($leiCode) |
||
522 | |||
523 | /** |
||
524 | * The location of for example where the event is happening, an organization |
||
525 | * is located, or where an action takes place. |
||
526 | * |
||
527 | * @param \Spatie\SchemaOrg\Contracts\PlaceContract|\Spatie\SchemaOrg\Contracts\PlaceContract[]|\Spatie\SchemaOrg\Contracts\PostalAddressContract|\Spatie\SchemaOrg\Contracts\PostalAddressContract[]|string|string[] $location |
||
528 | * |
||
529 | * @return static |
||
530 | * |
||
531 | * @see http://schema.org/location |
||
532 | */ |
||
533 | public function location($location) |
||
537 | |||
538 | /** |
||
539 | * An associated logo. |
||
540 | * |
||
541 | * @param \Spatie\SchemaOrg\Contracts\ImageObjectContract|\Spatie\SchemaOrg\Contracts\ImageObjectContract[]|string|string[] $logo |
||
542 | * |
||
543 | * @return static |
||
544 | * |
||
545 | * @see http://schema.org/logo |
||
546 | */ |
||
547 | public function logo($logo) |
||
551 | |||
552 | /** |
||
553 | * Indicates a page (or other CreativeWork) for which this thing is the main |
||
554 | * entity being described. See [background |
||
555 | * notes](/docs/datamodel.html#mainEntityBackground) for details. |
||
556 | * |
||
557 | * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|string|string[] $mainEntityOfPage |
||
558 | * |
||
559 | * @return static |
||
560 | * |
||
561 | * @see http://schema.org/mainEntityOfPage |
||
562 | */ |
||
563 | public function mainEntityOfPage($mainEntityOfPage) |
||
567 | |||
568 | /** |
||
569 | * A pointer to products or services offered by the organization or person. |
||
570 | * |
||
571 | * @param \Spatie\SchemaOrg\Contracts\OfferContract|\Spatie\SchemaOrg\Contracts\OfferContract[] $makesOffer |
||
572 | * |
||
573 | * @return static |
||
574 | * |
||
575 | * @see http://schema.org/makesOffer |
||
576 | */ |
||
577 | public function makesOffer($makesOffer) |
||
581 | |||
582 | /** |
||
583 | * A member of an Organization or a ProgramMembership. Organizations can be |
||
584 | * members of organizations; ProgramMembership is typically for individuals. |
||
585 | * |
||
586 | * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[]|\Spatie\SchemaOrg\Contracts\PersonContract|\Spatie\SchemaOrg\Contracts\PersonContract[] $member |
||
587 | * |
||
588 | * @return static |
||
589 | * |
||
590 | * @see http://schema.org/member |
||
591 | */ |
||
592 | public function member($member) |
||
596 | |||
597 | /** |
||
598 | * An Organization (or ProgramMembership) to which this Person or |
||
599 | * Organization belongs. |
||
600 | * |
||
601 | * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[]|\Spatie\SchemaOrg\Contracts\ProgramMembershipContract|\Spatie\SchemaOrg\Contracts\ProgramMembershipContract[] $memberOf |
||
602 | * |
||
603 | * @return static |
||
604 | * |
||
605 | * @see http://schema.org/memberOf |
||
606 | */ |
||
607 | public function memberOf($memberOf) |
||
611 | |||
612 | /** |
||
613 | * A member of this organization. |
||
614 | * |
||
615 | * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[]|\Spatie\SchemaOrg\Contracts\PersonContract|\Spatie\SchemaOrg\Contracts\PersonContract[] $members |
||
616 | * |
||
617 | * @return static |
||
618 | * |
||
619 | * @see http://schema.org/members |
||
620 | */ |
||
621 | public function members($members) |
||
625 | |||
626 | /** |
||
627 | * The North American Industry Classification System (NAICS) code for a |
||
628 | * particular organization or business person. |
||
629 | * |
||
630 | * @param string|string[] $naics |
||
631 | * |
||
632 | * @return static |
||
633 | * |
||
634 | * @see http://schema.org/naics |
||
635 | */ |
||
636 | public function naics($naics) |
||
640 | |||
641 | /** |
||
642 | * The name of the item. |
||
643 | * |
||
644 | * @param string|string[] $name |
||
645 | * |
||
646 | * @return static |
||
647 | * |
||
648 | * @see http://schema.org/name |
||
649 | */ |
||
650 | public function name($name) |
||
654 | |||
655 | /** |
||
656 | * The number of employees in an organization e.g. business. |
||
657 | * |
||
658 | * @param \Spatie\SchemaOrg\Contracts\QuantitativeValueContract|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract[] $numberOfEmployees |
||
659 | * |
||
660 | * @return static |
||
661 | * |
||
662 | * @see http://schema.org/numberOfEmployees |
||
663 | */ |
||
664 | public function numberOfEmployees($numberOfEmployees) |
||
668 | |||
669 | /** |
||
670 | * A pointer to the organization or person making the offer. |
||
671 | * |
||
672 | * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[]|\Spatie\SchemaOrg\Contracts\PersonContract|\Spatie\SchemaOrg\Contracts\PersonContract[] $offeredBy |
||
673 | * |
||
674 | * @return static |
||
675 | * |
||
676 | * @see http://schema.org/offeredBy |
||
677 | */ |
||
678 | public function offeredBy($offeredBy) |
||
682 | |||
683 | /** |
||
684 | * Products owned by the organization or person. |
||
685 | * |
||
686 | * @param \Spatie\SchemaOrg\Contracts\OwnershipInfoContract|\Spatie\SchemaOrg\Contracts\OwnershipInfoContract[]|\Spatie\SchemaOrg\Contracts\ProductContract|\Spatie\SchemaOrg\Contracts\ProductContract[] $owns |
||
687 | * |
||
688 | * @return static |
||
689 | * |
||
690 | * @see http://schema.org/owns |
||
691 | */ |
||
692 | public function owns($owns) |
||
696 | |||
697 | /** |
||
698 | * The larger organization that this organization is a [[subOrganization]] |
||
699 | * of, if any. |
||
700 | * |
||
701 | * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[] $parentOrganization |
||
702 | * |
||
703 | * @return static |
||
704 | * |
||
705 | * @see http://schema.org/parentOrganization |
||
706 | */ |
||
707 | public function parentOrganization($parentOrganization) |
||
711 | |||
712 | /** |
||
713 | * Indicates a potential Action, which describes an idealized action in |
||
714 | * which this thing would play an 'object' role. |
||
715 | * |
||
716 | * @param \Spatie\SchemaOrg\Contracts\ActionContract|\Spatie\SchemaOrg\Contracts\ActionContract[] $potentialAction |
||
717 | * |
||
718 | * @return static |
||
719 | * |
||
720 | * @see http://schema.org/potentialAction |
||
721 | */ |
||
722 | public function potentialAction($potentialAction) |
||
726 | |||
727 | /** |
||
728 | * The publishingPrinciples property indicates (typically via [[URL]]) a |
||
729 | * document describing the editorial principles of an [[Organization]] (or |
||
730 | * individual e.g. a [[Person]] writing a blog) that relate to their |
||
731 | * activities as a publisher, e.g. ethics or diversity policies. When |
||
732 | * applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are |
||
733 | * those of the party primarily responsible for the creation of the |
||
734 | * [[CreativeWork]]. |
||
735 | * |
||
736 | * While such policies are most typically expressed in natural language, |
||
737 | * sometimes related information (e.g. indicating a [[funder]]) can be |
||
738 | * expressed using schema.org terminology. |
||
739 | * |
||
740 | * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|string|string[] $publishingPrinciples |
||
741 | * |
||
742 | * @return static |
||
743 | * |
||
744 | * @see http://schema.org/publishingPrinciples |
||
745 | */ |
||
746 | public function publishingPrinciples($publishingPrinciples) |
||
750 | |||
751 | /** |
||
752 | * A review of the item. |
||
753 | * |
||
754 | * @param \Spatie\SchemaOrg\Contracts\ReviewContract|\Spatie\SchemaOrg\Contracts\ReviewContract[] $review |
||
755 | * |
||
756 | * @return static |
||
757 | * |
||
758 | * @see http://schema.org/review |
||
759 | */ |
||
760 | public function review($review) |
||
764 | |||
765 | /** |
||
766 | * Review of the item. |
||
767 | * |
||
768 | * @param \Spatie\SchemaOrg\Contracts\ReviewContract|\Spatie\SchemaOrg\Contracts\ReviewContract[] $reviews |
||
769 | * |
||
770 | * @return static |
||
771 | * |
||
772 | * @see http://schema.org/reviews |
||
773 | */ |
||
774 | public function reviews($reviews) |
||
778 | |||
779 | /** |
||
780 | * URL of a reference Web page that unambiguously indicates the item's |
||
781 | * identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or |
||
782 | * official website. |
||
783 | * |
||
784 | * @param string|string[] $sameAs |
||
785 | * |
||
786 | * @return static |
||
787 | * |
||
788 | * @see http://schema.org/sameAs |
||
789 | */ |
||
790 | public function sameAs($sameAs) |
||
794 | |||
795 | /** |
||
796 | * A pointer to products or services sought by the organization or person |
||
797 | * (demand). |
||
798 | * |
||
799 | * @param \Spatie\SchemaOrg\Contracts\DemandContract|\Spatie\SchemaOrg\Contracts\DemandContract[] $seeks |
||
800 | * |
||
801 | * @return static |
||
802 | * |
||
803 | * @see http://schema.org/seeks |
||
804 | */ |
||
805 | public function seeks($seeks) |
||
809 | |||
810 | /** |
||
811 | * The geographic area where the service is provided. |
||
812 | * |
||
813 | * @param \Spatie\SchemaOrg\Contracts\AdministrativeAreaContract|\Spatie\SchemaOrg\Contracts\AdministrativeAreaContract[]|\Spatie\SchemaOrg\Contracts\GeoShapeContract|\Spatie\SchemaOrg\Contracts\GeoShapeContract[]|\Spatie\SchemaOrg\Contracts\PlaceContract|\Spatie\SchemaOrg\Contracts\PlaceContract[] $serviceArea |
||
814 | * |
||
815 | * @return static |
||
816 | * |
||
817 | * @see http://schema.org/serviceArea |
||
818 | */ |
||
819 | public function serviceArea($serviceArea) |
||
823 | |||
824 | /** |
||
825 | * A slogan or motto associated with the item. |
||
826 | * |
||
827 | * @param string|string[] $slogan |
||
828 | * |
||
829 | * @return static |
||
830 | * |
||
831 | * @see http://schema.org/slogan |
||
832 | */ |
||
833 | public function slogan($slogan) |
||
837 | |||
838 | /** |
||
839 | * A person or organization that supports a thing through a pledge, promise, |
||
840 | * or financial contribution. e.g. a sponsor of a Medical Study or a |
||
841 | * corporate sponsor of an event. |
||
842 | * |
||
843 | * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[]|\Spatie\SchemaOrg\Contracts\PersonContract|\Spatie\SchemaOrg\Contracts\PersonContract[] $sponsor |
||
844 | * |
||
845 | * @return static |
||
846 | * |
||
847 | * @see http://schema.org/sponsor |
||
848 | */ |
||
849 | public function sponsor($sponsor) |
||
853 | |||
854 | /** |
||
855 | * A relationship between two organizations where the first includes the |
||
856 | * second, e.g., as a subsidiary. See also: the more specific 'department' |
||
857 | * property. |
||
858 | * |
||
859 | * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[] $subOrganization |
||
860 | * |
||
861 | * @return static |
||
862 | * |
||
863 | * @see http://schema.org/subOrganization |
||
864 | */ |
||
865 | public function subOrganization($subOrganization) |
||
869 | |||
870 | /** |
||
871 | * A CreativeWork or Event about this Thing. |
||
872 | * |
||
873 | * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|\Spatie\SchemaOrg\Contracts\EventContract|\Spatie\SchemaOrg\Contracts\EventContract[] $subjectOf |
||
874 | * |
||
875 | * @return static |
||
876 | * |
||
877 | * @see http://schema.org/subjectOf |
||
878 | */ |
||
879 | public function subjectOf($subjectOf) |
||
883 | |||
884 | /** |
||
885 | * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US |
||
886 | * or the CIF/NIF in Spain. |
||
887 | * |
||
888 | * @param string|string[] $taxID |
||
889 | * |
||
890 | * @return static |
||
891 | * |
||
892 | * @see http://schema.org/taxID |
||
893 | */ |
||
894 | public function taxID($taxID) |
||
898 | |||
899 | /** |
||
900 | * The telephone number. |
||
901 | * |
||
902 | * @param string|string[] $telephone |
||
903 | * |
||
904 | * @return static |
||
905 | * |
||
906 | * @see http://schema.org/telephone |
||
907 | */ |
||
908 | public function telephone($telephone) |
||
912 | |||
913 | /** |
||
914 | * URL of the item. |
||
915 | * |
||
916 | * @param string|string[] $url |
||
917 | * |
||
918 | * @return static |
||
919 | * |
||
920 | * @see http://schema.org/url |
||
921 | */ |
||
922 | public function url($url) |
||
926 | |||
927 | /** |
||
928 | * The Value-added Tax ID of the organization or person. |
||
929 | * |
||
930 | * @param string|string[] $vatID |
||
931 | * |
||
932 | * @return static |
||
933 | * |
||
934 | * @see http://schema.org/vatID |
||
935 | */ |
||
936 | public function vatID($vatID) |
||
940 | |||
941 | } |
||
942 |
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.