CreditsafeProfitAndLossFigures   C
last analyzed

Complexity

Total Complexity 55

Size/Duplication

Total Lines 654
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 654
rs 5.352
c 0
b 0
f 0
wmc 55

47 Methods

Rating   Name   Duplication   Size   Complexity  
A setAmortisation() 0 4 1
A __toString() 0 3 1
A getRetained_profit() 0 3 1
A getNumber_of_weeks() 0 3 1
A setConsolidated_accounts() 0 8 3
A getOperating_profit() 0 3 1
A setPension_costs() 0 4 1
A setTax() 0 4 1
A setOther_appropriations() 0 4 1
A setFinancial_income() 0 4 1
A getFinancial_income() 0 3 1
A setWages_and_salaries() 0 4 1
A setProfit_after_tax() 0 4 1
A getMinority_interests() 0 3 1
A getAmortisation() 0 3 1
A setProfit_before_tax() 0 4 1
A getOther_appropriations() 0 3 1
A getOperating_costs() 0 3 1
A getCurrency() 0 3 1
A getExtraordinary_income() 0 3 1
B __construct() 0 25 1
A setRetained_profit() 0 4 1
A setOperating_costs() 0 4 1
A setMinority_interests() 0 4 1
A setExtraordinary_costs() 0 4 1
A __set_state() 0 3 1
A getExtraordinary_costs() 0 3 1
A getProfit_after_tax() 0 3 1
A setRevenue() 0 4 1
A getPension_costs() 0 3 1
A getConsolidated_accounts() 0 3 1
A setExtraordinary_income() 0 4 1
A getRevenue() 0 3 1
A setFinancial_expenses() 0 4 1
A setDepreciation() 0 4 1
A getTax() 0 3 1
A setCurrency() 0 8 3
A getDepreciation() 0 3 1
A setOperating_profit() 0 4 1
A setDividends() 0 4 1
A getProfit_before_tax() 0 3 1
A getWages_and_salaries() 0 3 1
A setYear_end_date() 0 8 3
A getFinancial_expenses() 0 3 1
A getDividends() 0 3 1
A setNumber_of_weeks() 0 8 3
A getYear_end_date() 0 3 1

How to fix   Complexity   

Complex Class

Complex classes like CreditsafeProfitAndLossFigures 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.

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 CreditsafeProfitAndLossFigures, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace Webservices\StructType;
4
5
use \WsdlToPhp\PackageBase\AbstractStructBase;
6
7
/**
8
 * This class stands for CreditsafeProfitAndLossFigures StructType
9
 * @subpackage Structs
10
 * @author JCID <[email protected]>
11
 */
12
class CreditsafeProfitAndLossFigures extends AbstractStructBase
13
{
14
    /**
15
     * The year_end_date
16
     * @var string
17
     */
18
    public $year_end_date;
19
    /**
20
     * The number_of_weeks
21
     * @var int
22
     */
23
    public $number_of_weeks;
24
    /**
25
     * The currency
26
     * @var string
27
     */
28
    public $currency;
29
    /**
30
     * The consolidated_accounts
31
     * Meta informations extracted from the WSDL
32
     * - minOccurs: 0
33
     * @var bool
34
     */
35
    public $consolidated_accounts;
36
    /**
37
     * The revenue
38
     * Meta informations extracted from the WSDL
39
     * - minOccurs: 0
40
     * @var float
41
     */
42
    public $revenue;
43
    /**
44
     * The operating_costs
45
     * Meta informations extracted from the WSDL
46
     * - minOccurs: 0
47
     * @var float
48
     */
49
    public $operating_costs;
50
    /**
51
     * The operating_profit
52
     * Meta informations extracted from the WSDL
53
     * - minOccurs: 0
54
     * @var float
55
     */
56
    public $operating_profit;
57
    /**
58
     * The wages_and_salaries
59
     * Meta informations extracted from the WSDL
60
     * - minOccurs: 0
61
     * @var float
62
     */
63
    public $wages_and_salaries;
64
    /**
65
     * The pension_costs
66
     * Meta informations extracted from the WSDL
67
     * - minOccurs: 0
68
     * @var float
69
     */
70
    public $pension_costs;
71
    /**
72
     * The depreciation
73
     * Meta informations extracted from the WSDL
74
     * - minOccurs: 0
75
     * @var float
76
     */
77
    public $depreciation;
78
    /**
79
     * The amortisation
80
     * Meta informations extracted from the WSDL
81
     * - minOccurs: 0
82
     * @var float
83
     */
84
    public $amortisation;
85
    /**
86
     * The financial_income
87
     * Meta informations extracted from the WSDL
88
     * - minOccurs: 0
89
     * @var float
90
     */
91
    public $financial_income;
92
    /**
93
     * The financial_expenses
94
     * Meta informations extracted from the WSDL
95
     * - minOccurs: 0
96
     * @var float
97
     */
98
    public $financial_expenses;
99
    /**
100
     * The extraordinary_income
101
     * Meta informations extracted from the WSDL
102
     * - minOccurs: 0
103
     * @var float
104
     */
105
    public $extraordinary_income;
106
    /**
107
     * The extraordinary_costs
108
     * Meta informations extracted from the WSDL
109
     * - minOccurs: 0
110
     * @var float
111
     */
112
    public $extraordinary_costs;
113
    /**
114
     * The profit_before_tax
115
     * Meta informations extracted from the WSDL
116
     * - minOccurs: 0
117
     * @var float
118
     */
119
    public $profit_before_tax;
120
    /**
121
     * The tax
122
     * Meta informations extracted from the WSDL
123
     * - minOccurs: 0
124
     * @var float
125
     */
126
    public $tax;
127
    /**
128
     * The profit_after_tax
129
     * Meta informations extracted from the WSDL
130
     * - minOccurs: 0
131
     * @var float
132
     */
133
    public $profit_after_tax;
134
    /**
135
     * The dividends
136
     * Meta informations extracted from the WSDL
137
     * - minOccurs: 0
138
     * @var float
139
     */
140
    public $dividends;
141
    /**
142
     * The minority_interests
143
     * Meta informations extracted from the WSDL
144
     * - minOccurs: 0
145
     * @var float
146
     */
147
    public $minority_interests;
148
    /**
149
     * The other_appropriations
150
     * Meta informations extracted from the WSDL
151
     * - minOccurs: 0
152
     * @var float
153
     */
154
    public $other_appropriations;
155
    /**
156
     * The retained_profit
157
     * Meta informations extracted from the WSDL
158
     * - minOccurs: 0
159
     * @var float
160
     */
161
    public $retained_profit;
162
    /**
163
     * Constructor method for CreditsafeProfitAndLossFigures
164
     * @uses CreditsafeProfitAndLossFigures::setYear_end_date()
165
     * @uses CreditsafeProfitAndLossFigures::setNumber_of_weeks()
166
     * @uses CreditsafeProfitAndLossFigures::setCurrency()
167
     * @uses CreditsafeProfitAndLossFigures::setConsolidated_accounts()
168
     * @uses CreditsafeProfitAndLossFigures::setRevenue()
169
     * @uses CreditsafeProfitAndLossFigures::setOperating_costs()
170
     * @uses CreditsafeProfitAndLossFigures::setOperating_profit()
171
     * @uses CreditsafeProfitAndLossFigures::setWages_and_salaries()
172
     * @uses CreditsafeProfitAndLossFigures::setPension_costs()
173
     * @uses CreditsafeProfitAndLossFigures::setDepreciation()
174
     * @uses CreditsafeProfitAndLossFigures::setAmortisation()
175
     * @uses CreditsafeProfitAndLossFigures::setFinancial_income()
176
     * @uses CreditsafeProfitAndLossFigures::setFinancial_expenses()
177
     * @uses CreditsafeProfitAndLossFigures::setExtraordinary_income()
178
     * @uses CreditsafeProfitAndLossFigures::setExtraordinary_costs()
179
     * @uses CreditsafeProfitAndLossFigures::setProfit_before_tax()
180
     * @uses CreditsafeProfitAndLossFigures::setTax()
181
     * @uses CreditsafeProfitAndLossFigures::setProfit_after_tax()
182
     * @uses CreditsafeProfitAndLossFigures::setDividends()
183
     * @uses CreditsafeProfitAndLossFigures::setMinority_interests()
184
     * @uses CreditsafeProfitAndLossFigures::setOther_appropriations()
185
     * @uses CreditsafeProfitAndLossFigures::setRetained_profit()
186
     * @param string $year_end_date
187
     * @param int $number_of_weeks
188
     * @param string $currency
189
     * @param bool $consolidated_accounts
190
     * @param float $revenue
191
     * @param float $operating_costs
192
     * @param float $operating_profit
193
     * @param float $wages_and_salaries
194
     * @param float $pension_costs
195
     * @param float $depreciation
196
     * @param float $amortisation
197
     * @param float $financial_income
198
     * @param float $financial_expenses
199
     * @param float $extraordinary_income
200
     * @param float $extraordinary_costs
201
     * @param float $profit_before_tax
202
     * @param float $tax
203
     * @param float $profit_after_tax
204
     * @param float $dividends
205
     * @param float $minority_interests
206
     * @param float $other_appropriations
207
     * @param float $retained_profit
208
     */
209
    public function __construct($year_end_date = null, $number_of_weeks = null, $currency = null, $consolidated_accounts = null, $revenue = null, $operating_costs = null, $operating_profit = null, $wages_and_salaries = null, $pension_costs = null, $depreciation = null, $amortisation = null, $financial_income = null, $financial_expenses = null, $extraordinary_income = null, $extraordinary_costs = null, $profit_before_tax = null, $tax = null, $profit_after_tax = null, $dividends = null, $minority_interests = null, $other_appropriations = null, $retained_profit = null)
210
    {
211
        $this
212
            ->setYear_end_date($year_end_date)
213
            ->setNumber_of_weeks($number_of_weeks)
214
            ->setCurrency($currency)
215
            ->setConsolidated_accounts($consolidated_accounts)
216
            ->setRevenue($revenue)
217
            ->setOperating_costs($operating_costs)
218
            ->setOperating_profit($operating_profit)
219
            ->setWages_and_salaries($wages_and_salaries)
220
            ->setPension_costs($pension_costs)
221
            ->setDepreciation($depreciation)
222
            ->setAmortisation($amortisation)
223
            ->setFinancial_income($financial_income)
224
            ->setFinancial_expenses($financial_expenses)
225
            ->setExtraordinary_income($extraordinary_income)
226
            ->setExtraordinary_costs($extraordinary_costs)
227
            ->setProfit_before_tax($profit_before_tax)
228
            ->setTax($tax)
229
            ->setProfit_after_tax($profit_after_tax)
230
            ->setDividends($dividends)
231
            ->setMinority_interests($minority_interests)
232
            ->setOther_appropriations($other_appropriations)
233
            ->setRetained_profit($retained_profit);
234
    }
235
    /**
236
     * Get year_end_date value
237
     * @return string|null
238
     */
239
    public function getYear_end_date()
240
    {
241
        return $this->year_end_date;
242
    }
243
    /**
244
     * Set year_end_date value
245
     * @param string $year_end_date
246
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
247
     */
248
    public function setYear_end_date($year_end_date = null)
249
    {
250
        // validation for constraint: string
251
        if (!is_null($year_end_date) && !is_string($year_end_date)) {
0 ignored issues
show
introduced by
The condition ! is_null($year_end_date..._string($year_end_date) can never be true.
Loading history...
252
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($year_end_date)), __LINE__);
253
        }
254
        $this->year_end_date = $year_end_date;
255
        return $this;
256
    }
257
    /**
258
     * Get number_of_weeks value
259
     * @return int|null
260
     */
261
    public function getNumber_of_weeks()
262
    {
263
        return $this->number_of_weeks;
264
    }
265
    /**
266
     * Set number_of_weeks value
267
     * @param int $number_of_weeks
268
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
269
     */
270
    public function setNumber_of_weeks($number_of_weeks = null)
271
    {
272
        // validation for constraint: int
273
        if (!is_null($number_of_weeks) && !is_numeric($number_of_weeks)) {
0 ignored issues
show
introduced by
The condition ! is_null($number_of_wee...meric($number_of_weeks) can never be true.
Loading history...
274
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($number_of_weeks)), __LINE__);
275
        }
276
        $this->number_of_weeks = $number_of_weeks;
277
        return $this;
278
    }
279
    /**
280
     * Get currency value
281
     * @return string|null
282
     */
283
    public function getCurrency()
284
    {
285
        return $this->currency;
286
    }
287
    /**
288
     * Set currency value
289
     * @param string $currency
290
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
291
     */
292
    public function setCurrency($currency = null)
293
    {
294
        // validation for constraint: string
295
        if (!is_null($currency) && !is_string($currency)) {
0 ignored issues
show
introduced by
The condition ! is_null($currency) && ! is_string($currency) can never be true.
Loading history...
296
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($currency)), __LINE__);
297
        }
298
        $this->currency = $currency;
299
        return $this;
300
    }
301
    /**
302
     * Get consolidated_accounts value
303
     * @return bool|null
304
     */
305
    public function getConsolidated_accounts()
306
    {
307
        return $this->consolidated_accounts;
308
    }
309
    /**
310
     * Set consolidated_accounts value
311
     * @param bool $consolidated_accounts
312
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
313
     */
314
    public function setConsolidated_accounts($consolidated_accounts = null)
315
    {
316
        // validation for constraint: boolean
317
        if (!is_null($consolidated_accounts) && !is_bool($consolidated_accounts)) {
0 ignored issues
show
introduced by
The condition ! is_null($consolidated_...$consolidated_accounts) can never be true.
Loading history...
318
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($consolidated_accounts)), __LINE__);
319
        }
320
        $this->consolidated_accounts = $consolidated_accounts;
321
        return $this;
322
    }
323
    /**
324
     * Get revenue value
325
     * @return float|null
326
     */
327
    public function getRevenue()
328
    {
329
        return $this->revenue;
330
    }
331
    /**
332
     * Set revenue value
333
     * @param float $revenue
334
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
335
     */
336
    public function setRevenue($revenue = null)
337
    {
338
        $this->revenue = $revenue;
339
        return $this;
340
    }
341
    /**
342
     * Get operating_costs value
343
     * @return float|null
344
     */
345
    public function getOperating_costs()
346
    {
347
        return $this->operating_costs;
348
    }
349
    /**
350
     * Set operating_costs value
351
     * @param float $operating_costs
352
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
353
     */
354
    public function setOperating_costs($operating_costs = null)
355
    {
356
        $this->operating_costs = $operating_costs;
357
        return $this;
358
    }
359
    /**
360
     * Get operating_profit value
361
     * @return float|null
362
     */
363
    public function getOperating_profit()
364
    {
365
        return $this->operating_profit;
366
    }
367
    /**
368
     * Set operating_profit value
369
     * @param float $operating_profit
370
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
371
     */
372
    public function setOperating_profit($operating_profit = null)
373
    {
374
        $this->operating_profit = $operating_profit;
375
        return $this;
376
    }
377
    /**
378
     * Get wages_and_salaries value
379
     * @return float|null
380
     */
381
    public function getWages_and_salaries()
382
    {
383
        return $this->wages_and_salaries;
384
    }
385
    /**
386
     * Set wages_and_salaries value
387
     * @param float $wages_and_salaries
388
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
389
     */
390
    public function setWages_and_salaries($wages_and_salaries = null)
391
    {
392
        $this->wages_and_salaries = $wages_and_salaries;
393
        return $this;
394
    }
395
    /**
396
     * Get pension_costs value
397
     * @return float|null
398
     */
399
    public function getPension_costs()
400
    {
401
        return $this->pension_costs;
402
    }
403
    /**
404
     * Set pension_costs value
405
     * @param float $pension_costs
406
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
407
     */
408
    public function setPension_costs($pension_costs = null)
409
    {
410
        $this->pension_costs = $pension_costs;
411
        return $this;
412
    }
413
    /**
414
     * Get depreciation value
415
     * @return float|null
416
     */
417
    public function getDepreciation()
418
    {
419
        return $this->depreciation;
420
    }
421
    /**
422
     * Set depreciation value
423
     * @param float $depreciation
424
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
425
     */
426
    public function setDepreciation($depreciation = null)
427
    {
428
        $this->depreciation = $depreciation;
429
        return $this;
430
    }
431
    /**
432
     * Get amortisation value
433
     * @return float|null
434
     */
435
    public function getAmortisation()
436
    {
437
        return $this->amortisation;
438
    }
439
    /**
440
     * Set amortisation value
441
     * @param float $amortisation
442
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
443
     */
444
    public function setAmortisation($amortisation = null)
445
    {
446
        $this->amortisation = $amortisation;
447
        return $this;
448
    }
449
    /**
450
     * Get financial_income value
451
     * @return float|null
452
     */
453
    public function getFinancial_income()
454
    {
455
        return $this->financial_income;
456
    }
457
    /**
458
     * Set financial_income value
459
     * @param float $financial_income
460
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
461
     */
462
    public function setFinancial_income($financial_income = null)
463
    {
464
        $this->financial_income = $financial_income;
465
        return $this;
466
    }
467
    /**
468
     * Get financial_expenses value
469
     * @return float|null
470
     */
471
    public function getFinancial_expenses()
472
    {
473
        return $this->financial_expenses;
474
    }
475
    /**
476
     * Set financial_expenses value
477
     * @param float $financial_expenses
478
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
479
     */
480
    public function setFinancial_expenses($financial_expenses = null)
481
    {
482
        $this->financial_expenses = $financial_expenses;
483
        return $this;
484
    }
485
    /**
486
     * Get extraordinary_income value
487
     * @return float|null
488
     */
489
    public function getExtraordinary_income()
490
    {
491
        return $this->extraordinary_income;
492
    }
493
    /**
494
     * Set extraordinary_income value
495
     * @param float $extraordinary_income
496
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
497
     */
498
    public function setExtraordinary_income($extraordinary_income = null)
499
    {
500
        $this->extraordinary_income = $extraordinary_income;
501
        return $this;
502
    }
503
    /**
504
     * Get extraordinary_costs value
505
     * @return float|null
506
     */
507
    public function getExtraordinary_costs()
508
    {
509
        return $this->extraordinary_costs;
510
    }
511
    /**
512
     * Set extraordinary_costs value
513
     * @param float $extraordinary_costs
514
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
515
     */
516
    public function setExtraordinary_costs($extraordinary_costs = null)
517
    {
518
        $this->extraordinary_costs = $extraordinary_costs;
519
        return $this;
520
    }
521
    /**
522
     * Get profit_before_tax value
523
     * @return float|null
524
     */
525
    public function getProfit_before_tax()
526
    {
527
        return $this->profit_before_tax;
528
    }
529
    /**
530
     * Set profit_before_tax value
531
     * @param float $profit_before_tax
532
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
533
     */
534
    public function setProfit_before_tax($profit_before_tax = null)
535
    {
536
        $this->profit_before_tax = $profit_before_tax;
537
        return $this;
538
    }
539
    /**
540
     * Get tax value
541
     * @return float|null
542
     */
543
    public function getTax()
544
    {
545
        return $this->tax;
546
    }
547
    /**
548
     * Set tax value
549
     * @param float $tax
550
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
551
     */
552
    public function setTax($tax = null)
553
    {
554
        $this->tax = $tax;
555
        return $this;
556
    }
557
    /**
558
     * Get profit_after_tax value
559
     * @return float|null
560
     */
561
    public function getProfit_after_tax()
562
    {
563
        return $this->profit_after_tax;
564
    }
565
    /**
566
     * Set profit_after_tax value
567
     * @param float $profit_after_tax
568
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
569
     */
570
    public function setProfit_after_tax($profit_after_tax = null)
571
    {
572
        $this->profit_after_tax = $profit_after_tax;
573
        return $this;
574
    }
575
    /**
576
     * Get dividends value
577
     * @return float|null
578
     */
579
    public function getDividends()
580
    {
581
        return $this->dividends;
582
    }
583
    /**
584
     * Set dividends value
585
     * @param float $dividends
586
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
587
     */
588
    public function setDividends($dividends = null)
589
    {
590
        $this->dividends = $dividends;
591
        return $this;
592
    }
593
    /**
594
     * Get minority_interests value
595
     * @return float|null
596
     */
597
    public function getMinority_interests()
598
    {
599
        return $this->minority_interests;
600
    }
601
    /**
602
     * Set minority_interests value
603
     * @param float $minority_interests
604
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
605
     */
606
    public function setMinority_interests($minority_interests = null)
607
    {
608
        $this->minority_interests = $minority_interests;
609
        return $this;
610
    }
611
    /**
612
     * Get other_appropriations value
613
     * @return float|null
614
     */
615
    public function getOther_appropriations()
616
    {
617
        return $this->other_appropriations;
618
    }
619
    /**
620
     * Set other_appropriations value
621
     * @param float $other_appropriations
622
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
623
     */
624
    public function setOther_appropriations($other_appropriations = null)
625
    {
626
        $this->other_appropriations = $other_appropriations;
627
        return $this;
628
    }
629
    /**
630
     * Get retained_profit value
631
     * @return float|null
632
     */
633
    public function getRetained_profit()
634
    {
635
        return $this->retained_profit;
636
    }
637
    /**
638
     * Set retained_profit value
639
     * @param float $retained_profit
640
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
641
     */
642
    public function setRetained_profit($retained_profit = null)
643
    {
644
        $this->retained_profit = $retained_profit;
645
        return $this;
646
    }
647
    /**
648
     * Method called when an object has been exported with var_export() functions
649
     * It allows to return an object instantiated with the values
650
     * @see AbstractStructBase::__set_state()
651
     * @uses AbstractStructBase::__set_state()
652
     * @param array $array the exported values
653
     * @return \Webservices\StructType\CreditsafeProfitAndLossFigures
654
     */
655
    public static function __set_state(array $array)
656
    {
657
        return parent::__set_state($array);
658
    }
659
    /**
660
     * Method returning the class name
661
     * @return string __CLASS__
662
     */
663
    public function __toString()
664
    {
665
        return __CLASS__;
666
    }
667
}
668