GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Customer   B
last analyzed

Complexity

Total Complexity 42

Size/Duplication

Total Lines 690
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 42
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 690
rs 8.034
ccs 0
cts 162
cp 0

42 Methods

Rating   Name   Duplication   Size   Complexity  
A getCustomerId() 0 4 1
A setCustomerId() 0 6 1
A getCustomerExternalId() 0 4 1
A setCustomerExternalId() 0 6 1
A getHash() 0 4 1
A setHash() 0 6 1
A getCustomerNumber() 0 4 1
A setCustomerNumber() 0 6 1
A getCompanyName() 0 4 1
A setCompanyName() 0 6 1
A getTitle() 0 4 1
A setTitle() 0 6 1
A getSalutation() 0 4 1
A setSalutation() 0 6 1
A getFirstName() 0 4 1
A setFirstName() 0 6 1
A getLastName() 0 4 1
A setLastName() 0 6 1
A getAddress() 0 4 1
A setAddress() 0 6 1
A getAddress2() 0 4 1
A setAddress2() 0 6 1
A getZipCode() 0 4 1
A setZipCode() 0 6 1
A getCity() 0 4 1
A setCity() 0 6 1
A getCountryCode() 0 4 1
A setCountryCode() 0 6 1
A getEmail() 0 4 1
A setEmail() 0 6 1
A getPhone() 0 4 1
A setPhone() 0 6 1
A getPaymentDataUrl() 0 4 1
A setPaymentDataUrl() 0 6 1
A getDashboardUrl() 0 4 1
A setDashboardUrl() 0 6 1
A getVatId() 0 4 1
A setVatId() 0 6 1
A getTaxId() 0 4 1
A setTaxId() 0 6 1
A getLanguageCode() 0 4 1
A setLanguageCode() 0 6 1

How to fix   Complexity   

Complex Class

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

1
<?php
2
3
namespace Speicher210\Monsum\Api\Model\Notification\Customer;
4
5
use JMS\Serializer\Annotation as JMS;
6
7
/**
8
 * Customer in a notification model.
9
 */
10
class Customer
11
{
12
    /**
13
     * The customer ID.
14
     *
15
     * @var integer
16
     *
17
     * @JMS\Type("integer")
18
     * @JMS\SerializedName("customer_id")
19
     */
20
    protected $customerId;
21
22
    /**
23
     * The external customer ID.
24
     *
25
     * @var string
26
     *
27
     * @JMS\Type("string")
28
     * @JMS\SerializedName("customer_ext_uid")
29
     */
30
    protected $customerExternalId;
31
32
    /**
33
     * Hash.
34
     *
35
     * @var string
36
     *
37
     * @JMS\Type("string")
38
     * @JMS\SerializedName("hash")
39
     */
40
    protected $hash;
41
42
    /**
43
     * The own customer number.
44
     *
45
     * @var string
46
     *
47
     * @JMS\Type("string")
48
     * @JMS\SerializedName("customer_number")
49
     */
50
    protected $customerNumber;
51
52
    /**
53
     * The company name of the customer.
54
     *
55
     * @var string
56
     *
57
     * @JMS\Type("string")
58
     * @JMS\SerializedName("companyname")
59
     */
60
    protected $companyName;
61
62
    /**
63
     * The VAT identification number of the customer.
64
     *
65
     * @var string
66
     *
67
     * @JMS\Type("string")
68
     * @JMS\SerializedName("vat_id")
69
     */
70
    protected $vatId;
71
72
    /**
73
     * Tax ID of the customer.
74
     *
75
     * @var string
76
     *
77
     * @JMS\Type("string")
78
     * @JMS\SerializedName("tax_id")
79
     */
80
    protected $taxId;
81
82
    /**
83
     * The academic title of the customer.
84
     *
85
     * @var string
86
     *
87
     * @JMS\Type("string")
88
     * @JMS\SerializedName("title")
89
     */
90
    protected $title;
91
92
    /**
93
     * The salutation of the customer.
94
     *
95
     * @var string
96
     *
97
     * @JMS\Type("string")
98
     * @JMS\SerializedName("salutation")
99
     */
100
    protected $salutation;
101
102
    /**
103
     * The first name of the customer.
104
     *
105
     * @var string
106
     *
107
     * @JMS\Type("string")
108
     * @JMS\SerializedName("firstname")
109
     */
110
    protected $firstName;
111
112
    /**
113
     * The last name of the customer.
114
     *
115
     * @var string
116
     *
117
     * @JMS\Type("string")
118
     * @JMS\SerializedName("lastname")
119
     */
120
    protected $lastName;
121
122
    /**
123
     * The address of the customer.
124
     *
125
     * @var string
126
     *
127
     * @JMS\Type("string")
128
     * @JMS\SerializedName("address")
129
     */
130
    protected $address;
131
132
    /**
133
     * The second row of an address of the customer.
134
     *
135
     * @var string
136
     *
137
     * @JMS\Type("string")
138
     * @JMS\SerializedName("address_2")
139
     */
140
    protected $address2;
141
142
    /**
143
     * The zip code of the customer.
144
     *
145
     * @var string
146
     *
147
     * @JMS\Type("string")
148
     * @JMS\SerializedName("zipcode")
149
     */
150
    protected $zipCode;
151
152
    /**
153
     * The city of the customer.
154
     *
155
     * @var string
156
     *
157
     * @JMS\Type("string")
158
     * @JMS\SerializedName("city")
159
     */
160
    protected $city;
161
162
    /**
163
     * The country code of the customer.
164
     *
165
     * @var string
166
     *
167
     * @JMS\Type("string")
168
     * @JMS\SerializedName("country_code")
169
     */
170
    protected $countryCode;
171
172
    /**
173
     * The language code of the customer.
174
     *
175
     * @var string
176
     *
177
     * @JMS\Type("string")
178
     * @JMS\SerializedName("language_code")
179
     */
180
    protected $languageCode;
181
182
    /**
183
     * The email address of the customer.
184
     *
185
     * @var string
186
     *
187
     * @JMS\Type("string")
188
     * @JMS\SerializedName("email")
189
     */
190
    protected $email;
191
192
    /**
193
     * The phone number of the customer.
194
     *
195
     * @var string
196
     * @JMS\Type("string")
197
     * @JMS\SerializedName("phone")
198
     */
199
    protected $phone;
200
201
    /**
202
     * The payment data URL.
203
     *
204
     * @var string
205
     *
206
     * @JMS\Type("string")
207
     * @JMS\SerializedName("payment_data_url")
208
     */
209
    protected $paymentDataUrl;
210
211
    /**
212
     * The dashboard URL.
213
     *
214
     * @var string
215
     *
216
     * @JMS\Type("string")
217
     * @JMS\SerializedName("dashboard_url")
218
     */
219
    protected $dashboardUrl;
220
221
    /**
222
     * @return int
223
     */
224
    public function getCustomerId()
225
    {
226
        return $this->customerId;
227
    }
228
229
    /**
230
     * @param int $customerId
231
     * @return Customer
232
     */
233
    public function setCustomerId($customerId)
234
    {
235
        $this->customerId = $customerId;
236
237
        return $this;
238
    }
239
240
    /**
241
     * Get the customer external ID.
242
     *
243
     * @return int
244
     */
245
    public function getCustomerExternalId()
246
    {
247
        return $this->customerExternalId;
248
    }
249
250
    /**
251
     * Set the customer external ID.
252
     *
253
     * @param int $customerExternalId The customer external ID.
254
     * @return Customer
255
     */
256
    public function setCustomerExternalId($customerExternalId)
257
    {
258
        $this->customerExternalId = $customerExternalId;
0 ignored issues
show
Documentation Bug introduced by
The property $customerExternalId was declared of type string, but $customerExternalId is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
259
260
        return $this;
261
    }
262
263
    /**
264
     * Get the hash.
265
     *
266
     * @return string
267
     */
268
    public function getHash()
269
    {
270
        return $this->hash;
271
    }
272
273
    /**
274
     * Set the hash.
275
     *
276
     * @param string $hash The hash.
277
     * @return Customer
278
     */
279
    public function setHash($hash)
280
    {
281
        $this->hash = $hash;
282
283
        return $this;
284
    }
285
286
    /**
287
     * Get the customer number.
288
     *
289
     * @return int The customer number.
290
     */
291
    public function getCustomerNumber()
292
    {
293
        return $this->customerNumber;
294
    }
295
296
    /**
297
     * Set the customer number.
298
     *
299
     * @param int $customerNumber The customer number.
300
     * @return Customer
301
     */
302
    public function setCustomerNumber($customerNumber)
303
    {
304
        $this->customerNumber = $customerNumber;
0 ignored issues
show
Documentation Bug introduced by
The property $customerNumber was declared of type string, but $customerNumber is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
305
306
        return $this;
307
    }
308
309
    /**
310
     * Get the company name.
311
     *
312
     * @return string
313
     */
314
    public function getCompanyName()
315
    {
316
        return $this->companyName;
317
    }
318
319
    /**
320
     * Set the company name.
321
     *
322
     * @param string $companyName The company name.
323
     * @return Customer
324
     */
325
    public function setCompanyName($companyName)
326
    {
327
        $this->companyName = $companyName;
328
329
        return $this;
330
    }
331
332
    /**
333
     * Get the VAT ID.
334
     *
335
     * @return string
336
     */
337
    public function getVatId()
338
    {
339
        return $this->vatId;
340
    }
341
342
    /**
343
     * Set the VAT ID.
344
     *
345
     * @param string $vatId The VAT ID.
346
     * @return $this
347
     */
348
    public function setVatId($vatId)
349
    {
350
        $this->vatId = $vatId;
351
352
        return $this;
353
    }
354
355
    /**
356
     * Get the tax ID.
357
     *
358
     * @return string
359
     */
360
    public function getTaxId()
361
    {
362
        return $this->taxId;
363
    }
364
365
    /**
366
     * Set the tax ID.
367
     *
368
     * @param string $taxId The tax ID.
369
     * @return $this
370
     */
371
    public function setTaxId($taxId)
372
    {
373
        $this->taxId = $taxId;
374
375
        return $this;
376
    }
377
378
    /**
379
     * Get the title.
380
     *
381
     * @return string
382
     */
383
    public function getTitle()
384
    {
385
        return $this->title;
386
    }
387
388
    /**
389
     * Set the title.
390
     *
391
     * @param string $title The title.
392
     * @return Customer
393
     */
394
    public function setTitle($title)
395
    {
396
        $this->title = $title;
397
398
        return $this;
399
    }
400
401
    /**
402
     * Get the salutation.
403
     *
404
     * @return string
405
     */
406
    public function getSalutation()
407
    {
408
        return $this->salutation;
409
    }
410
411
    /**
412
     * Set the salutation.
413
     *
414
     * @param string $salutation The salutation.
415
     * @return Customer
416
     */
417
    public function setSalutation($salutation)
418
    {
419
        $this->salutation = $salutation;
420
421
        return $this;
422
    }
423
424
    /**
425
     * Get the first name.
426
     *
427
     * @return string
428
     */
429
    public function getFirstName()
430
    {
431
        return $this->firstName;
432
    }
433
434
    /**
435
     * Set the first name.
436
     *
437
     * @param string $firstName The first name.
438
     * @return Customer
439
     */
440
    public function setFirstName($firstName)
441
    {
442
        $this->firstName = $firstName;
443
444
        return $this;
445
    }
446
447
    /**
448
     * Get the last name.
449
     *
450
     * @return string
451
     */
452
    public function getLastName()
453
    {
454
        return $this->lastName;
455
    }
456
457
    /**
458
     * Set the last name.
459
     *
460
     * @param string $lastName The last name.
461
     * @return Customer
462
     */
463
    public function setLastName($lastName)
464
    {
465
        $this->lastName = $lastName;
466
467
        return $this;
468
    }
469
470
    /**
471
     * Get the address.
472
     *
473
     * @return string
474
     */
475
    public function getAddress()
476
    {
477
        return $this->address;
478
    }
479
480
    /**
481
     * Set the address.
482
     *
483
     * @param string $address The address.
484
     * @return Customer
485
     */
486
    public function setAddress($address)
487
    {
488
        $this->address = $address;
489
490
        return $this;
491
    }
492
493
    /**
494
     * Get the address2.
495
     *
496
     * @return string
497
     */
498
    public function getAddress2()
499
    {
500
        return $this->address2;
501
    }
502
503
    /**
504
     * Set the address2.
505
     *
506
     * @param string $address2 The address2.
507
     * @return Customer
508
     */
509
    public function setAddress2($address2)
510
    {
511
        $this->address2 = $address2;
512
513
        return $this;
514
    }
515
516
    /**
517
     * Get the zip code.
518
     *
519
     * @return string
520
     */
521
    public function getZipCode()
522
    {
523
        return $this->zipCode;
524
    }
525
526
    /**
527
     * Set the zip code.
528
     *
529
     * @param string $zipCode The zip code.
530
     * @return Customer
531
     */
532
    public function setZipCode($zipCode)
533
    {
534
        $this->zipCode = $zipCode;
535
536
        return $this;
537
    }
538
539
    /**
540
     * Get the city.
541
     *
542
     * @return string
543
     */
544
    public function getCity()
545
    {
546
        return $this->city;
547
    }
548
549
    /**
550
     * Set the city.
551
     *
552
     * @param string $city The city.
553
     * @return Customer
554
     */
555
    public function setCity($city)
556
    {
557
        $this->city = $city;
558
559
        return $this;
560
    }
561
562
    /**
563
     * Get the country code.
564
     *
565
     * @return string
566
     */
567
    public function getCountryCode()
568
    {
569
        return $this->countryCode;
570
    }
571
572
    /**
573
     * Set the country code.
574
     *
575
     * @param string $countryCode The country code.
576
     * @return Customer
577
     */
578
    public function setCountryCode($countryCode)
579
    {
580
        $this->countryCode = $countryCode;
581
582
        return $this;
583
    }
584
585
    /**
586
     * Get the language code.
587
     *
588
     * @return string
589
     */
590
    public function getLanguageCode()
591
    {
592
        return $this->languageCode;
593
    }
594
595
    /**
596
     * Set the language code.
597
     *
598
     * @param string $languageCode The language code.
599
     * @return $this
600
     */
601
    public function setLanguageCode($languageCode)
602
    {
603
        $this->languageCode = $languageCode;
604
605
        return $this;
606
    }
607
608
    /**
609
     * Get the email.
610
     *
611
     * @return string
612
     */
613
    public function getEmail()
614
    {
615
        return $this->email;
616
    }
617
618
    /**
619
     * Set the email.
620
     *
621
     * @param string $email The email.
622
     * @return Customer
623
     */
624
    public function setEmail($email)
625
    {
626
        $this->email = $email;
627
628
        return $this;
629
    }
630
631
    /**
632
     * Get the phone number of the customer.
633
     *
634
     * @return string
635
     */
636
    public function getPhone()
637
    {
638
        return $this->phone;
639
    }
640
641
    /**
642
     * Set the phone number of the customer.
643
     *
644
     * @param string $phone The phone number to set.
645
     * @return $this
646
     */
647
    public function setPhone($phone)
648
    {
649
        $this->phone = $phone;
650
651
        return $this;
652
    }
653
654
    /**
655
     * Get the payment data URL.
656
     *
657
     * @return string
658
     */
659
    public function getPaymentDataUrl()
660
    {
661
        return $this->paymentDataUrl;
662
    }
663
664
    /**
665
     * Set the payment data URL.
666
     *
667
     * @param string $paymentDataUrl The payment data URL.
668
     * @return Customer
669
     */
670
    public function setPaymentDataUrl($paymentDataUrl)
671
    {
672
        $this->paymentDataUrl = $paymentDataUrl;
673
674
        return $this;
675
    }
676
677
    /**
678
     * Get the dashboard URL.
679
     *
680
     * @return string
681
     */
682
    public function getDashboardUrl()
683
    {
684
        return $this->dashboardUrl;
685
    }
686
687
    /**
688
     * Set the dashboard URL.
689
     *
690
     * @param string $dashboardUrl The dashboard URL.
691
     * @return Customer
692
     */
693
    public function setDashboardUrl($dashboardUrl)
694
    {
695
        $this->dashboardUrl = $dashboardUrl;
696
697
        return $this;
698
    }
699
}
700