Completed
Push — master ( fd0635...f2796c )
by Tom
06:08
created

Person   D

Complexity

Total Complexity 57

Size/Duplication

Total Lines 833
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 57
lcom 1
cbo 1
dl 0
loc 833
rs 4.807
c 0
b 0
f 0

57 Methods

Rating   Name   Duplication   Size   Complexity  
A additionalName() 0 4 1
A address() 0 4 1
A affiliation() 0 4 1
A alumniOf() 0 4 1
A award() 0 4 1
A awards() 0 4 1
A birthDate() 0 4 1
A birthPlace() 0 4 1
A brand() 0 4 1
A children() 0 4 1
A colleague() 0 4 1
A colleagues() 0 4 1
A contactPoint() 0 4 1
A contactPoints() 0 4 1
A deathDate() 0 4 1
A deathPlace() 0 4 1
A duns() 0 4 1
A email() 0 4 1
A familyName() 0 4 1
A faxNumber() 0 4 1
A follows() 0 4 1
A funder() 0 4 1
A gender() 0 4 1
A givenName() 0 4 1
A globalLocationNumber() 0 4 1
A hasOccupation() 0 4 1
A hasOfferCatalog() 0 4 1
A hasPOS() 0 4 1
A height() 0 4 1
A homeLocation() 0 4 1
A honorificPrefix() 0 4 1
A honorificSuffix() 0 4 1
A isicV4() 0 4 1
A jobTitle() 0 4 1
A knows() 0 4 1
A makesOffer() 0 4 1
A memberOf() 0 4 1
A naics() 0 4 1
A nationality() 0 4 1
A netWorth() 0 4 1
A owns() 0 4 1
A parent() 0 4 1
A parents() 0 4 1
A performerIn() 0 4 1
A publishingPrinciples() 0 4 1
A relatedTo() 0 4 1
A seeks() 0 4 1
A sibling() 0 4 1
A siblings() 0 4 1
A sponsor() 0 4 1
A spouse() 0 4 1
A taxID() 0 4 1
A telephone() 0 4 1
A vatID() 0 4 1
A weight() 0 4 1
A workLocation() 0 4 1
A worksFor() 0 4 1

How to fix   Complexity   

Complex Class

Complex classes like Person 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 Person, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace Spatie\SchemaOrg;
4
5
/**
6
 * A person (alive, dead, undead, or fictional).
7
 *
8
 * @see http://schema.org/Person
9
 *
10
 * @mixin \Spatie\SchemaOrg\Thing
11
 */
12
class Person extends BaseType
13
{
14
    /**
15
     * An additional name for a Person, can be used for a middle name.
16
     *
17
     * @param string|string[] $additionalName
18
     *
19
     * @return static
20
     *
21
     * @see http://schema.org/additionalName
22
     */
23
    public function additionalName($additionalName)
24
    {
25
        return $this->setProperty('additionalName', $additionalName);
26
    }
27
28
    /**
29
     * Physical address of the item.
30
     *
31
     * @param PostalAddress|PostalAddress[]|string|string[] $address
32
     *
33
     * @return static
34
     *
35
     * @see http://schema.org/address
36
     */
37
    public function address($address)
38
    {
39
        return $this->setProperty('address', $address);
40
    }
41
42
    /**
43
     * An organization that this person is affiliated with. For example, a
44
     * school/university, a club, or a team.
45
     *
46
     * @param Organization|Organization[] $affiliation
47
     *
48
     * @return static
49
     *
50
     * @see http://schema.org/affiliation
51
     */
52
    public function affiliation($affiliation)
53
    {
54
        return $this->setProperty('affiliation', $affiliation);
55
    }
56
57
    /**
58
     * An organization that the person is an alumni of.
59
     *
60
     * @param EducationalOrganization|EducationalOrganization[] $alumniOf
61
     *
62
     * @return static
63
     *
64
     * @see http://schema.org/alumniOf
65
     */
66
    public function alumniOf($alumniOf)
67
    {
68
        return $this->setProperty('alumniOf', $alumniOf);
69
    }
70
71
    /**
72
     * An award won by or for this item.
73
     *
74
     * @param string|string[] $award
75
     *
76
     * @return static
77
     *
78
     * @see http://schema.org/award
79
     */
80
    public function award($award)
81
    {
82
        return $this->setProperty('award', $award);
83
    }
84
85
    /**
86
     * Awards won by or for this item.
87
     *
88
     * @param string|string[] $awards
89
     *
90
     * @return static
91
     *
92
     * @see http://schema.org/awards
93
     */
94
    public function awards($awards)
95
    {
96
        return $this->setProperty('awards', $awards);
97
    }
98
99
    /**
100
     * Date of birth.
101
     *
102
     * @param \DateTimeInterface|\DateTimeInterface[] $birthDate
103
     *
104
     * @return static
105
     *
106
     * @see http://schema.org/birthDate
107
     */
108
    public function birthDate($birthDate)
109
    {
110
        return $this->setProperty('birthDate', $birthDate);
111
    }
112
113
    /**
114
     * The place where the person was born.
115
     *
116
     * @param Place|Place[] $birthPlace
117
     *
118
     * @return static
119
     *
120
     * @see http://schema.org/birthPlace
121
     */
122
    public function birthPlace($birthPlace)
123
    {
124
        return $this->setProperty('birthPlace', $birthPlace);
125
    }
126
127
    /**
128
     * The brand(s) associated with a product or service, or the brand(s)
129
     * maintained by an organization or business person.
130
     *
131
     * @param Brand|Brand[]|Organization|Organization[] $brand
132
     *
133
     * @return static
134
     *
135
     * @see http://schema.org/brand
136
     */
137
    public function brand($brand)
138
    {
139
        return $this->setProperty('brand', $brand);
140
    }
141
142
    /**
143
     * A child of the person.
144
     *
145
     * @param Person|Person[] $children
146
     *
147
     * @return static
148
     *
149
     * @see http://schema.org/children
150
     */
151
    public function children($children)
152
    {
153
        return $this->setProperty('children', $children);
154
    }
155
156
    /**
157
     * A colleague of the person.
158
     *
159
     * @param Person|Person[]|string|string[] $colleague
160
     *
161
     * @return static
162
     *
163
     * @see http://schema.org/colleague
164
     */
165
    public function colleague($colleague)
166
    {
167
        return $this->setProperty('colleague', $colleague);
168
    }
169
170
    /**
171
     * A colleague of the person.
172
     *
173
     * @param Person|Person[] $colleagues
174
     *
175
     * @return static
176
     *
177
     * @see http://schema.org/colleagues
178
     */
179
    public function colleagues($colleagues)
180
    {
181
        return $this->setProperty('colleagues', $colleagues);
182
    }
183
184
    /**
185
     * A contact point for a person or organization.
186
     *
187
     * @param ContactPoint|ContactPoint[] $contactPoint
188
     *
189
     * @return static
190
     *
191
     * @see http://schema.org/contactPoint
192
     */
193
    public function contactPoint($contactPoint)
194
    {
195
        return $this->setProperty('contactPoint', $contactPoint);
196
    }
197
198
    /**
199
     * A contact point for a person or organization.
200
     *
201
     * @param ContactPoint|ContactPoint[] $contactPoints
202
     *
203
     * @return static
204
     *
205
     * @see http://schema.org/contactPoints
206
     */
207
    public function contactPoints($contactPoints)
208
    {
209
        return $this->setProperty('contactPoints', $contactPoints);
210
    }
211
212
    /**
213
     * Date of death.
214
     *
215
     * @param \DateTimeInterface|\DateTimeInterface[] $deathDate
216
     *
217
     * @return static
218
     *
219
     * @see http://schema.org/deathDate
220
     */
221
    public function deathDate($deathDate)
222
    {
223
        return $this->setProperty('deathDate', $deathDate);
224
    }
225
226
    /**
227
     * The place where the person died.
228
     *
229
     * @param Place|Place[] $deathPlace
230
     *
231
     * @return static
232
     *
233
     * @see http://schema.org/deathPlace
234
     */
235
    public function deathPlace($deathPlace)
236
    {
237
        return $this->setProperty('deathPlace', $deathPlace);
238
    }
239
240
    /**
241
     * The Dun & Bradstreet DUNS number for identifying an organization or
242
     * business person.
243
     *
244
     * @param string|string[] $duns
245
     *
246
     * @return static
247
     *
248
     * @see http://schema.org/duns
249
     */
250
    public function duns($duns)
251
    {
252
        return $this->setProperty('duns', $duns);
253
    }
254
255
    /**
256
     * Email address.
257
     *
258
     * @param string|string[] $email
259
     *
260
     * @return static
261
     *
262
     * @see http://schema.org/email
263
     */
264
    public function email($email)
265
    {
266
        return $this->setProperty('email', $email);
267
    }
268
269
    /**
270
     * Family name. In the U.S., the last name of an Person. This can be used
271
     * along with givenName instead of the name property.
272
     *
273
     * @param string|string[] $familyName
274
     *
275
     * @return static
276
     *
277
     * @see http://schema.org/familyName
278
     */
279
    public function familyName($familyName)
280
    {
281
        return $this->setProperty('familyName', $familyName);
282
    }
283
284
    /**
285
     * The fax number.
286
     *
287
     * @param string|string[] $faxNumber
288
     *
289
     * @return static
290
     *
291
     * @see http://schema.org/faxNumber
292
     */
293
    public function faxNumber($faxNumber)
294
    {
295
        return $this->setProperty('faxNumber', $faxNumber);
296
    }
297
298
    /**
299
     * The most generic uni-directional social relation.
300
     *
301
     * @param Person|Person[] $follows
302
     *
303
     * @return static
304
     *
305
     * @see http://schema.org/follows
306
     */
307
    public function follows($follows)
308
    {
309
        return $this->setProperty('follows', $follows);
310
    }
311
312
    /**
313
     * A person or organization that supports (sponsors) something through some
314
     * kind of financial contribution.
315
     *
316
     * @param Organization|Organization[]|Person|Person[] $funder
317
     *
318
     * @return static
319
     *
320
     * @see http://schema.org/funder
321
     */
322
    public function funder($funder)
323
    {
324
        return $this->setProperty('funder', $funder);
325
    }
326
327
    /**
328
     * Gender of the person. While http://schema.org/Male and
329
     * http://schema.org/Female may be used, text strings are also acceptable
330
     * for people who do not identify as a binary gender.
331
     *
332
     * @param GenderType|GenderType[]|string|string[] $gender
333
     *
334
     * @return static
335
     *
336
     * @see http://schema.org/gender
337
     */
338
    public function gender($gender)
339
    {
340
        return $this->setProperty('gender', $gender);
341
    }
342
343
    /**
344
     * Given name. In the U.S., the first name of a Person. This can be used
345
     * along with familyName instead of the name property.
346
     *
347
     * @param string|string[] $givenName
348
     *
349
     * @return static
350
     *
351
     * @see http://schema.org/givenName
352
     */
353
    public function givenName($givenName)
354
    {
355
        return $this->setProperty('givenName', $givenName);
356
    }
357
358
    /**
359
     * The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also
360
     * referred to as International Location Number or ILN) of the respective
361
     * organization, person, or place. The GLN is a 13-digit number used to
362
     * identify parties and physical locations.
363
     *
364
     * @param string|string[] $globalLocationNumber
365
     *
366
     * @return static
367
     *
368
     * @see http://schema.org/globalLocationNumber
369
     */
370
    public function globalLocationNumber($globalLocationNumber)
371
    {
372
        return $this->setProperty('globalLocationNumber', $globalLocationNumber);
373
    }
374
375
    /**
376
     * The Person's occupation. For past professions, use Role for expressing
377
     * dates.
378
     *
379
     * @param Occupation|Occupation[] $hasOccupation
380
     *
381
     * @return static
382
     *
383
     * @see http://schema.org/hasOccupation
384
     */
385
    public function hasOccupation($hasOccupation)
386
    {
387
        return $this->setProperty('hasOccupation', $hasOccupation);
388
    }
389
390
    /**
391
     * Indicates an OfferCatalog listing for this Organization, Person, or
392
     * Service.
393
     *
394
     * @param OfferCatalog|OfferCatalog[] $hasOfferCatalog
395
     *
396
     * @return static
397
     *
398
     * @see http://schema.org/hasOfferCatalog
399
     */
400
    public function hasOfferCatalog($hasOfferCatalog)
401
    {
402
        return $this->setProperty('hasOfferCatalog', $hasOfferCatalog);
403
    }
404
405
    /**
406
     * Points-of-Sales operated by the organization or person.
407
     *
408
     * @param Place|Place[] $hasPOS
409
     *
410
     * @return static
411
     *
412
     * @see http://schema.org/hasPOS
413
     */
414
    public function hasPOS($hasPOS)
415
    {
416
        return $this->setProperty('hasPOS', $hasPOS);
417
    }
418
419
    /**
420
     * The height of the item.
421
     *
422
     * @param Distance|Distance[]|QuantitativeValue|QuantitativeValue[] $height
423
     *
424
     * @return static
425
     *
426
     * @see http://schema.org/height
427
     */
428
    public function height($height)
429
    {
430
        return $this->setProperty('height', $height);
431
    }
432
433
    /**
434
     * A contact location for a person's residence.
435
     *
436
     * @param ContactPoint|ContactPoint[]|Place|Place[] $homeLocation
437
     *
438
     * @return static
439
     *
440
     * @see http://schema.org/homeLocation
441
     */
442
    public function homeLocation($homeLocation)
443
    {
444
        return $this->setProperty('homeLocation', $homeLocation);
445
    }
446
447
    /**
448
     * An honorific prefix preceding a Person's name such as Dr/Mrs/Mr.
449
     *
450
     * @param string|string[] $honorificPrefix
451
     *
452
     * @return static
453
     *
454
     * @see http://schema.org/honorificPrefix
455
     */
456
    public function honorificPrefix($honorificPrefix)
457
    {
458
        return $this->setProperty('honorificPrefix', $honorificPrefix);
459
    }
460
461
    /**
462
     * An honorific suffix preceding a Person's name such as M.D. /PhD/MSCSW.
463
     *
464
     * @param string|string[] $honorificSuffix
465
     *
466
     * @return static
467
     *
468
     * @see http://schema.org/honorificSuffix
469
     */
470
    public function honorificSuffix($honorificSuffix)
471
    {
472
        return $this->setProperty('honorificSuffix', $honorificSuffix);
473
    }
474
475
    /**
476
     * The International Standard of Industrial Classification of All Economic
477
     * Activities (ISIC), Revision 4 code for a particular organization,
478
     * business person, or place.
479
     *
480
     * @param string|string[] $isicV4
481
     *
482
     * @return static
483
     *
484
     * @see http://schema.org/isicV4
485
     */
486
    public function isicV4($isicV4)
487
    {
488
        return $this->setProperty('isicV4', $isicV4);
489
    }
490
491
    /**
492
     * The job title of the person (for example, Financial Manager).
493
     *
494
     * @param string|string[] $jobTitle
495
     *
496
     * @return static
497
     *
498
     * @see http://schema.org/jobTitle
499
     */
500
    public function jobTitle($jobTitle)
501
    {
502
        return $this->setProperty('jobTitle', $jobTitle);
503
    }
504
505
    /**
506
     * The most generic bi-directional social/work relation.
507
     *
508
     * @param Person|Person[] $knows
509
     *
510
     * @return static
511
     *
512
     * @see http://schema.org/knows
513
     */
514
    public function knows($knows)
515
    {
516
        return $this->setProperty('knows', $knows);
517
    }
518
519
    /**
520
     * A pointer to products or services offered by the organization or person.
521
     *
522
     * @param Offer|Offer[] $makesOffer
523
     *
524
     * @return static
525
     *
526
     * @see http://schema.org/makesOffer
527
     */
528
    public function makesOffer($makesOffer)
529
    {
530
        return $this->setProperty('makesOffer', $makesOffer);
531
    }
532
533
    /**
534
     * An Organization (or ProgramMembership) to which this Person or
535
     * Organization belongs.
536
     *
537
     * @param Organization|Organization[]|ProgramMembership|ProgramMembership[] $memberOf
538
     *
539
     * @return static
540
     *
541
     * @see http://schema.org/memberOf
542
     */
543
    public function memberOf($memberOf)
544
    {
545
        return $this->setProperty('memberOf', $memberOf);
546
    }
547
548
    /**
549
     * The North American Industry Classification System (NAICS) code for a
550
     * particular organization or business person.
551
     *
552
     * @param string|string[] $naics
553
     *
554
     * @return static
555
     *
556
     * @see http://schema.org/naics
557
     */
558
    public function naics($naics)
559
    {
560
        return $this->setProperty('naics', $naics);
561
    }
562
563
    /**
564
     * Nationality of the person.
565
     *
566
     * @param Country|Country[] $nationality
567
     *
568
     * @return static
569
     *
570
     * @see http://schema.org/nationality
571
     */
572
    public function nationality($nationality)
573
    {
574
        return $this->setProperty('nationality', $nationality);
575
    }
576
577
    /**
578
     * The total financial value of the person as calculated by subtracting
579
     * assets from liabilities.
580
     *
581
     * @param MonetaryAmount|MonetaryAmount[]|PriceSpecification|PriceSpecification[] $netWorth
582
     *
583
     * @return static
584
     *
585
     * @see http://schema.org/netWorth
586
     */
587
    public function netWorth($netWorth)
588
    {
589
        return $this->setProperty('netWorth', $netWorth);
590
    }
591
592
    /**
593
     * Products owned by the organization or person.
594
     *
595
     * @param OwnershipInfo|OwnershipInfo[]|Product|Product[] $owns
596
     *
597
     * @return static
598
     *
599
     * @see http://schema.org/owns
600
     */
601
    public function owns($owns)
602
    {
603
        return $this->setProperty('owns', $owns);
604
    }
605
606
    /**
607
     * A parent of this person.
608
     *
609
     * @param Person|Person[] $parent
610
     *
611
     * @return static
612
     *
613
     * @see http://schema.org/parent
614
     */
615
    public function parent($parent)
616
    {
617
        return $this->setProperty('parent', $parent);
618
    }
619
620
    /**
621
     * A parents of the person.
622
     *
623
     * @param Person|Person[] $parents
624
     *
625
     * @return static
626
     *
627
     * @see http://schema.org/parents
628
     */
629
    public function parents($parents)
630
    {
631
        return $this->setProperty('parents', $parents);
632
    }
633
634
    /**
635
     * Event that this person is a performer or participant in.
636
     *
637
     * @param Event|Event[] $performerIn
638
     *
639
     * @return static
640
     *
641
     * @see http://schema.org/performerIn
642
     */
643
    public function performerIn($performerIn)
644
    {
645
        return $this->setProperty('performerIn', $performerIn);
646
    }
647
648
    /**
649
     * The publishingPrinciples property indicates (typically via [[URL]]) a
650
     * document describing the editorial principles of an [[Organization]] (or
651
     * individual e.g. a [[Person]] writing a blog) that relate to their
652
     * activities as a publisher, e.g. ethics or diversity policies. When
653
     * applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are
654
     * those of the party primarily responsible for the creation of the
655
     * [[CreativeWork]].
656
     * 
657
     * While such policies are most typically expressed in natural language,
658
     * sometimes related information (e.g. indicating a [[funder]]) can be
659
     * expressed using schema.org terminology.
660
     *
661
     * @param CreativeWork|CreativeWork[]|string|string[] $publishingPrinciples
662
     *
663
     * @return static
664
     *
665
     * @see http://schema.org/publishingPrinciples
666
     */
667
    public function publishingPrinciples($publishingPrinciples)
668
    {
669
        return $this->setProperty('publishingPrinciples', $publishingPrinciples);
670
    }
671
672
    /**
673
     * The most generic familial relation.
674
     *
675
     * @param Person|Person[] $relatedTo
676
     *
677
     * @return static
678
     *
679
     * @see http://schema.org/relatedTo
680
     */
681
    public function relatedTo($relatedTo)
682
    {
683
        return $this->setProperty('relatedTo', $relatedTo);
684
    }
685
686
    /**
687
     * A pointer to products or services sought by the organization or person
688
     * (demand).
689
     *
690
     * @param Demand|Demand[] $seeks
691
     *
692
     * @return static
693
     *
694
     * @see http://schema.org/seeks
695
     */
696
    public function seeks($seeks)
697
    {
698
        return $this->setProperty('seeks', $seeks);
699
    }
700
701
    /**
702
     * A sibling of the person.
703
     *
704
     * @param Person|Person[] $sibling
705
     *
706
     * @return static
707
     *
708
     * @see http://schema.org/sibling
709
     */
710
    public function sibling($sibling)
711
    {
712
        return $this->setProperty('sibling', $sibling);
713
    }
714
715
    /**
716
     * A sibling of the person.
717
     *
718
     * @param Person|Person[] $siblings
719
     *
720
     * @return static
721
     *
722
     * @see http://schema.org/siblings
723
     */
724
    public function siblings($siblings)
725
    {
726
        return $this->setProperty('siblings', $siblings);
727
    }
728
729
    /**
730
     * A person or organization that supports a thing through a pledge, promise,
731
     * or financial contribution. e.g. a sponsor of a Medical Study or a
732
     * corporate sponsor of an event.
733
     *
734
     * @param Organization|Organization[]|Person|Person[] $sponsor
735
     *
736
     * @return static
737
     *
738
     * @see http://schema.org/sponsor
739
     */
740
    public function sponsor($sponsor)
741
    {
742
        return $this->setProperty('sponsor', $sponsor);
743
    }
744
745
    /**
746
     * The person's spouse.
747
     *
748
     * @param Person|Person[] $spouse
749
     *
750
     * @return static
751
     *
752
     * @see http://schema.org/spouse
753
     */
754
    public function spouse($spouse)
755
    {
756
        return $this->setProperty('spouse', $spouse);
757
    }
758
759
    /**
760
     * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US
761
     * or the CIF/NIF in Spain.
762
     *
763
     * @param string|string[] $taxID
764
     *
765
     * @return static
766
     *
767
     * @see http://schema.org/taxID
768
     */
769
    public function taxID($taxID)
770
    {
771
        return $this->setProperty('taxID', $taxID);
772
    }
773
774
    /**
775
     * The telephone number.
776
     *
777
     * @param string|string[] $telephone
778
     *
779
     * @return static
780
     *
781
     * @see http://schema.org/telephone
782
     */
783
    public function telephone($telephone)
784
    {
785
        return $this->setProperty('telephone', $telephone);
786
    }
787
788
    /**
789
     * The Value-added Tax ID of the organization or person.
790
     *
791
     * @param string|string[] $vatID
792
     *
793
     * @return static
794
     *
795
     * @see http://schema.org/vatID
796
     */
797
    public function vatID($vatID)
798
    {
799
        return $this->setProperty('vatID', $vatID);
800
    }
801
802
    /**
803
     * The weight of the product or person.
804
     *
805
     * @param QuantitativeValue|QuantitativeValue[] $weight
806
     *
807
     * @return static
808
     *
809
     * @see http://schema.org/weight
810
     */
811
    public function weight($weight)
812
    {
813
        return $this->setProperty('weight', $weight);
814
    }
815
816
    /**
817
     * A contact location for a person's place of work.
818
     *
819
     * @param ContactPoint|ContactPoint[]|Place|Place[] $workLocation
820
     *
821
     * @return static
822
     *
823
     * @see http://schema.org/workLocation
824
     */
825
    public function workLocation($workLocation)
826
    {
827
        return $this->setProperty('workLocation', $workLocation);
828
    }
829
830
    /**
831
     * Organizations that the person works for.
832
     *
833
     * @param Organization|Organization[] $worksFor
834
     *
835
     * @return static
836
     *
837
     * @see http://schema.org/worksFor
838
     */
839
    public function worksFor($worksFor)
840
    {
841
        return $this->setProperty('worksFor', $worksFor);
842
    }
843
844
}
845