Passed
Push — master ( 583371...613693 )
by Alex
03:44
created

TAnonymousFunctionExpressionType   B

Complexity

Total Complexity 51

Size/Duplication

Total Lines 685
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 51
lcom 1
cbo 0
dl 0
loc 685
rs 7.628
c 0
b 0
f 0

51 Methods

Rating   Name   Duplication   Size   Complexity  
A addToParameters() 0 5 1
A issetParameters() 0 4 1
A unsetParameters() 0 4 1
A getParameters() 0 4 1
A setParameters() 0 5 1
A getString() 0 4 1
A setString() 0 5 1
A getBinary() 0 4 1
A setBinary() 0 5 1
A getInt() 0 4 1
A setInt() 0 5 1
A getFloat() 0 4 1
A setFloat() 0 5 1
A getGuid() 0 4 1
A setGuid() 0 5 1
A getDecimal() 0 4 1
A setDecimal() 0 5 1
A getBool() 0 4 1
A setBool() 0 5 1
A getDateTime() 0 4 1
A setDateTime() 0 5 1
A getDateTimeOffset() 0 4 1
A setDateTimeOffset() 0 5 1
A getEnum() 0 4 1
A setEnum() 0 5 1
A getPath() 0 4 1
A setPath() 0 5 1
A getIf() 0 4 1
A setIf() 0 5 1
A getRecord() 0 4 1
A setRecord() 0 5 1
A getCollection() 0 4 1
A setCollection() 0 5 1
A getTypeAssert() 0 4 1
A setTypeAssert() 0 5 1
A getTypeTest() 0 4 1
A setTypeTest() 0 5 1
A getFunctionReference() 0 4 1
A setFunctionReference() 0 5 1
A getEntitySetReference() 0 4 1
A setEntitySetReference() 0 5 1
A getAnonymousFunction() 0 4 1
A setAnonymousFunction() 0 5 1
A getParameterReference() 0 4 1
A setParameterReference() 0 5 1
A getApply() 0 4 1
A setApply() 0 5 1
A getPropertyReference() 0 4 1
A setPropertyReference() 0 5 1
A getValueTermReference() 0 4 1
A setValueTermReference() 0 5 1

How to fix   Complexity   

Complex Class

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

1
<?php
2
3
namespace AlgoWeb\ODataMetadata\MetadataV3\edm;
4
5
/**
6
 * Class representing TAnonymousFunctionExpressionType
7
 *
8
 *
9
 * XSD Type: TAnonymousFunctionExpression
10
 */
11
class TAnonymousFunctionExpressionType
12
{
13
14
    /**
15
     * @property \MetadataV3\edm\TFunctionParameterType[] $parameters
16
     */
17
    private $parameters = null;
18
19
    /**
20
     * @property string $string
21
     */
22
    private $string = null;
23
24
    /**
25
     * @property mixed $binary
26
     */
27
    private $binary = null;
28
29
    /**
30
     * @property integer $int
31
     */
32
    private $int = null;
33
34
    /**
35
     * @property float $float
36
     */
37
    private $float = null;
38
39
    /**
40
     * @property string $guid
41
     */
42
    private $guid = null;
43
44
    /**
45
     * @property float $decimal
46
     */
47
    private $decimal = null;
48
49
    /**
50
     * @property boolean $bool
51
     */
52
    private $bool = null;
53
54
    /**
55
     * @property \DateTime $dateTime
56
     */
57
    private $dateTime = null;
58
59
    /**
60
     * @property \DateTime $dateTimeOffset
61
     */
62
    private $dateTimeOffset = null;
63
64
    /**
65
     * @property string $enum
66
     */
67
    private $enum = null;
68
69
    /**
70
     * @property string $path
71
     */
72
    private $path = null;
73
74
    /**
75
     * @property \MetadataV3\edm\TIfExpressionType $if
76
     */
77
    private $if = null;
78
79
    /**
80
     * @property \MetadataV3\edm\TRecordExpressionType $record
81
     */
82
    private $record = null;
83
84
    /**
85
     * @property \MetadataV3\edm\TCollectionExpressionType $collection
86
     */
87
    private $collection = null;
88
89
    /**
90
     * @property \MetadataV3\edm\TTypeAssertExpressionType $typeAssert
91
     */
92
    private $typeAssert = null;
93
94
    /**
95
     * @property \MetadataV3\edm\TTypeTestExpressionType $typeTest
96
     */
97
    private $typeTest = null;
98
99
    /**
100
     * @property \MetadataV3\edm\TFunctionReferenceExpressionType $functionReference
101
     */
102
    private $functionReference = null;
103
104
    /**
105
     * @property \MetadataV3\edm\TEntitySetReferenceExpressionType $entitySetReference
106
     */
107
    private $entitySetReference = null;
108
109
    /**
110
     * @property \MetadataV3\edm\TAnonymousFunctionExpressionType $anonymousFunction
111
     */
112
    private $anonymousFunction = null;
113
114
    /**
115
     * @property \MetadataV3\edm\TParameterReferenceExpressionType $parameterReference
116
     */
117
    private $parameterReference = null;
118
119
    /**
120
     * @property \MetadataV3\edm\TApplyExpressionType $apply
121
     */
122
    private $apply = null;
123
124
    /**
125
     * @property \MetadataV3\edm\TPropertyReferenceExpressionType $propertyReference
126
     */
127
    private $propertyReference = null;
128
129
    /**
130
     * @property \MetadataV3\edm\TValueTermReferenceExpressionType $valueTermReference
131
     */
132
    private $valueTermReference = null;
133
134
    /**
135
     * Adds as parameter
136
     *
137
     * @return self
138
     * @param \MetadataV3\edm\TFunctionParameterType $parameter
139
     */
140
    public function addToParameters(\MetadataV3\edm\TFunctionParameterType $parameter)
141
    {
142
        $this->parameters[] = $parameter;
143
        return $this;
144
    }
145
146
    /**
147
     * isset parameters
148
     *
149
     * @param scalar $index
150
     * @return boolean
151
     */
152
    public function issetParameters($index)
153
    {
154
        return isset($this->parameters[$index]);
155
    }
156
157
    /**
158
     * unset parameters
159
     *
160
     * @param scalar $index
161
     * @return void
162
     */
163
    public function unsetParameters($index)
164
    {
165
        unset($this->parameters[$index]);
166
    }
167
168
    /**
169
     * Gets as parameters
170
     *
171
     * @return \MetadataV3\edm\TFunctionParameterType[]
172
     */
173
    public function getParameters()
174
    {
175
        return $this->parameters;
176
    }
177
178
    /**
179
     * Sets a new parameters
180
     *
181
     * @param \MetadataV3\edm\TFunctionParameterType[] $parameters
182
     * @return self
183
     */
184
    public function setParameters(array $parameters)
185
    {
186
        $this->parameters = $parameters;
187
        return $this;
188
    }
189
190
    /**
191
     * Gets as string
192
     *
193
     * @return string
194
     */
195
    public function getString()
196
    {
197
        return $this->string;
198
    }
199
200
    /**
201
     * Sets a new string
202
     *
203
     * @param string $string
204
     * @return self
205
     */
206
    public function setString($string)
207
    {
208
        $this->string = $string;
209
        return $this;
210
    }
211
212
    /**
213
     * Gets as binary
214
     *
215
     * @return mixed
216
     */
217
    public function getBinary()
218
    {
219
        return $this->binary;
220
    }
221
222
    /**
223
     * Sets a new binary
224
     *
225
     * @param mixed $binary
226
     * @return self
227
     */
228
    public function setBinary($binary)
229
    {
230
        $this->binary = $binary;
231
        return $this;
232
    }
233
234
    /**
235
     * Gets as int
236
     *
237
     * @return integer
238
     */
239
    public function getInt()
240
    {
241
        return $this->int;
242
    }
243
244
    /**
245
     * Sets a new int
246
     *
247
     * @param integer $int
248
     * @return self
249
     */
250
    public function setInt($int)
251
    {
252
        $this->int = $int;
253
        return $this;
254
    }
255
256
    /**
257
     * Gets as float
258
     *
259
     * @return float
260
     */
261
    public function getFloat()
262
    {
263
        return $this->float;
264
    }
265
266
    /**
267
     * Sets a new float
268
     *
269
     * @param float $float
270
     * @return self
271
     */
272
    public function setFloat($float)
273
    {
274
        $this->float = $float;
275
        return $this;
276
    }
277
278
    /**
279
     * Gets as guid
280
     *
281
     * @return string
282
     */
283
    public function getGuid()
284
    {
285
        return $this->guid;
286
    }
287
288
    /**
289
     * Sets a new guid
290
     *
291
     * @param string $guid
292
     * @return self
293
     */
294
    public function setGuid($guid)
295
    {
296
        $this->guid = $guid;
297
        return $this;
298
    }
299
300
    /**
301
     * Gets as decimal
302
     *
303
     * @return float
304
     */
305
    public function getDecimal()
306
    {
307
        return $this->decimal;
308
    }
309
310
    /**
311
     * Sets a new decimal
312
     *
313
     * @param float $decimal
314
     * @return self
315
     */
316
    public function setDecimal($decimal)
317
    {
318
        $this->decimal = $decimal;
319
        return $this;
320
    }
321
322
    /**
323
     * Gets as bool
324
     *
325
     * @return boolean
326
     */
327
    public function getBool()
328
    {
329
        return $this->bool;
330
    }
331
332
    /**
333
     * Sets a new bool
334
     *
335
     * @param boolean $bool
336
     * @return self
337
     */
338
    public function setBool($bool)
339
    {
340
        $this->bool = $bool;
341
        return $this;
342
    }
343
344
    /**
345
     * Gets as dateTime
346
     *
347
     * @return \DateTime
348
     */
349
    public function getDateTime()
350
    {
351
        return $this->dateTime;
352
    }
353
354
    /**
355
     * Sets a new dateTime
356
     *
357
     * @param \DateTime $dateTime
358
     * @return self
359
     */
360
    public function setDateTime(\DateTime $dateTime)
361
    {
362
        $this->dateTime = $dateTime;
363
        return $this;
364
    }
365
366
    /**
367
     * Gets as dateTimeOffset
368
     *
369
     * @return \DateTime
370
     */
371
    public function getDateTimeOffset()
372
    {
373
        return $this->dateTimeOffset;
374
    }
375
376
    /**
377
     * Sets a new dateTimeOffset
378
     *
379
     * @param \DateTime $dateTimeOffset
380
     * @return self
381
     */
382
    public function setDateTimeOffset(\DateTime $dateTimeOffset)
383
    {
384
        $this->dateTimeOffset = $dateTimeOffset;
385
        return $this;
386
    }
387
388
    /**
389
     * Gets as enum
390
     *
391
     * @return string
392
     */
393
    public function getEnum()
394
    {
395
        return $this->enum;
396
    }
397
398
    /**
399
     * Sets a new enum
400
     *
401
     * @param string $enum
402
     * @return self
403
     */
404
    public function setEnum($enum)
405
    {
406
        $this->enum = $enum;
407
        return $this;
408
    }
409
410
    /**
411
     * Gets as path
412
     *
413
     * @return string
414
     */
415
    public function getPath()
416
    {
417
        return $this->path;
418
    }
419
420
    /**
421
     * Sets a new path
422
     *
423
     * @param string $path
424
     * @return self
425
     */
426
    public function setPath($path)
427
    {
428
        $this->path = $path;
429
        return $this;
430
    }
431
432
    /**
433
     * Gets as if
434
     *
435
     * @return \MetadataV3\edm\TIfExpressionType
436
     */
437
    public function getIf()
438
    {
439
        return $this->if;
440
    }
441
442
    /**
443
     * Sets a new if
444
     *
445
     * @param \MetadataV3\edm\TIfExpressionType $if
446
     * @return self
447
     */
448
    public function setIf(\MetadataV3\edm\TIfExpressionType $if)
449
    {
450
        $this->if = $if;
451
        return $this;
452
    }
453
454
    /**
455
     * Gets as record
456
     *
457
     * @return \MetadataV3\edm\TRecordExpressionType
458
     */
459
    public function getRecord()
460
    {
461
        return $this->record;
462
    }
463
464
    /**
465
     * Sets a new record
466
     *
467
     * @param \MetadataV3\edm\TRecordExpressionType $record
468
     * @return self
469
     */
470
    public function setRecord(\MetadataV3\edm\TRecordExpressionType $record)
471
    {
472
        $this->record = $record;
473
        return $this;
474
    }
475
476
    /**
477
     * Gets as collection
478
     *
479
     * @return \MetadataV3\edm\TCollectionExpressionType
480
     */
481
    public function getCollection()
482
    {
483
        return $this->collection;
484
    }
485
486
    /**
487
     * Sets a new collection
488
     *
489
     * @param \MetadataV3\edm\TCollectionExpressionType $collection
490
     * @return self
491
     */
492
    public function setCollection(\MetadataV3\edm\TCollectionExpressionType $collection)
493
    {
494
        $this->collection = $collection;
495
        return $this;
496
    }
497
498
    /**
499
     * Gets as typeAssert
500
     *
501
     * @return \MetadataV3\edm\TTypeAssertExpressionType
502
     */
503
    public function getTypeAssert()
504
    {
505
        return $this->typeAssert;
506
    }
507
508
    /**
509
     * Sets a new typeAssert
510
     *
511
     * @param \MetadataV3\edm\TTypeAssertExpressionType $typeAssert
512
     * @return self
513
     */
514
    public function setTypeAssert(\MetadataV3\edm\TTypeAssertExpressionType $typeAssert)
515
    {
516
        $this->typeAssert = $typeAssert;
517
        return $this;
518
    }
519
520
    /**
521
     * Gets as typeTest
522
     *
523
     * @return \MetadataV3\edm\TTypeTestExpressionType
524
     */
525
    public function getTypeTest()
526
    {
527
        return $this->typeTest;
528
    }
529
530
    /**
531
     * Sets a new typeTest
532
     *
533
     * @param \MetadataV3\edm\TTypeTestExpressionType $typeTest
534
     * @return self
535
     */
536
    public function setTypeTest(\MetadataV3\edm\TTypeTestExpressionType $typeTest)
537
    {
538
        $this->typeTest = $typeTest;
539
        return $this;
540
    }
541
542
    /**
543
     * Gets as functionReference
544
     *
545
     * @return \MetadataV3\edm\TFunctionReferenceExpressionType
546
     */
547
    public function getFunctionReference()
548
    {
549
        return $this->functionReference;
550
    }
551
552
    /**
553
     * Sets a new functionReference
554
     *
555
     * @param \MetadataV3\edm\TFunctionReferenceExpressionType $functionReference
556
     * @return self
557
     */
558
    public function setFunctionReference(\MetadataV3\edm\TFunctionReferenceExpressionType $functionReference)
559
    {
560
        $this->functionReference = $functionReference;
561
        return $this;
562
    }
563
564
    /**
565
     * Gets as entitySetReference
566
     *
567
     * @return \MetadataV3\edm\TEntitySetReferenceExpressionType
568
     */
569
    public function getEntitySetReference()
570
    {
571
        return $this->entitySetReference;
572
    }
573
574
    /**
575
     * Sets a new entitySetReference
576
     *
577
     * @param \MetadataV3\edm\TEntitySetReferenceExpressionType $entitySetReference
578
     * @return self
579
     */
580
    public function setEntitySetReference(\MetadataV3\edm\TEntitySetReferenceExpressionType $entitySetReference)
581
    {
582
        $this->entitySetReference = $entitySetReference;
583
        return $this;
584
    }
585
586
    /**
587
     * Gets as anonymousFunction
588
     *
589
     * @return \MetadataV3\edm\TAnonymousFunctionExpressionType
590
     */
591
    public function getAnonymousFunction()
592
    {
593
        return $this->anonymousFunction;
594
    }
595
596
    /**
597
     * Sets a new anonymousFunction
598
     *
599
     * @param \MetadataV3\edm\TAnonymousFunctionExpressionType $anonymousFunction
600
     * @return self
601
     */
602
    public function setAnonymousFunction(\MetadataV3\edm\TAnonymousFunctionExpressionType $anonymousFunction)
603
    {
604
        $this->anonymousFunction = $anonymousFunction;
605
        return $this;
606
    }
607
608
    /**
609
     * Gets as parameterReference
610
     *
611
     * @return \MetadataV3\edm\TParameterReferenceExpressionType
612
     */
613
    public function getParameterReference()
614
    {
615
        return $this->parameterReference;
616
    }
617
618
    /**
619
     * Sets a new parameterReference
620
     *
621
     * @param \MetadataV3\edm\TParameterReferenceExpressionType $parameterReference
622
     * @return self
623
     */
624
    public function setParameterReference(\MetadataV3\edm\TParameterReferenceExpressionType $parameterReference)
625
    {
626
        $this->parameterReference = $parameterReference;
627
        return $this;
628
    }
629
630
    /**
631
     * Gets as apply
632
     *
633
     * @return \MetadataV3\edm\TApplyExpressionType
634
     */
635
    public function getApply()
636
    {
637
        return $this->apply;
638
    }
639
640
    /**
641
     * Sets a new apply
642
     *
643
     * @param \MetadataV3\edm\TApplyExpressionType $apply
644
     * @return self
645
     */
646
    public function setApply(\MetadataV3\edm\TApplyExpressionType $apply)
647
    {
648
        $this->apply = $apply;
649
        return $this;
650
    }
651
652
    /**
653
     * Gets as propertyReference
654
     *
655
     * @return \MetadataV3\edm\TPropertyReferenceExpressionType
656
     */
657
    public function getPropertyReference()
658
    {
659
        return $this->propertyReference;
660
    }
661
662
    /**
663
     * Sets a new propertyReference
664
     *
665
     * @param \MetadataV3\edm\TPropertyReferenceExpressionType $propertyReference
666
     * @return self
667
     */
668
    public function setPropertyReference(\MetadataV3\edm\TPropertyReferenceExpressionType $propertyReference)
669
    {
670
        $this->propertyReference = $propertyReference;
671
        return $this;
672
    }
673
674
    /**
675
     * Gets as valueTermReference
676
     *
677
     * @return \MetadataV3\edm\TValueTermReferenceExpressionType
678
     */
679
    public function getValueTermReference()
680
    {
681
        return $this->valueTermReference;
682
    }
683
684
    /**
685
     * Sets a new valueTermReference
686
     *
687
     * @param \MetadataV3\edm\TValueTermReferenceExpressionType $valueTermReference
688
     * @return self
689
     */
690
    public function setValueTermReference(\MetadataV3\edm\TValueTermReferenceExpressionType $valueTermReference)
691
    {
692
        $this->valueTermReference = $valueTermReference;
693
        return $this;
694
    }
695
}
696