BusinessInfoType::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 15
c 1
b 0
f 0
nc 1
nop 14
dl 0
loc 17
rs 9.7666

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
namespace PayPal\StructType;
4
5
use \WsdlToPhp\PackageBase\AbstractStructBase;
6
7
/**
8
 * This class stands for BusinessInfoType StructType
9
 * Meta information extracted from the WSDL
10
 * - documentation: BusinessInfoType
11
 * @subpackage Structs
12
 * @author WsdlToPhp <[email protected]>
13
 */
14
class BusinessInfoType extends AbstractStructBase
15
{
16
    /**
17
     * The Type
18
     * Meta information extracted from the WSDL
19
     * - documentation: Type of business, such as corporation or sole proprietorship
20
     * - minOccurs: 0
21
     * @var string
22
     */
23
    public $Type;
24
    /**
25
     * The Name
26
     * Meta information extracted from the WSDL
27
     * - documentation: Official name of business Character length and limitations: 75 alphanumeric characters
28
     * - base: xs:string
29
     * - maxLength: 25
30
     * - minOccurs: 0
31
     * @var string
32
     */
33
    public $Name;
34
    /**
35
     * The Address
36
     * Meta information extracted from the WSDL
37
     * - documentation: Merchantâs business postal address
38
     * - minOccurs: 0
39
     * @var \PayPal\StructType\AddressType
40
     */
41
    public $Address;
42
    /**
43
     * The WorkPhone
44
     * Meta information extracted from the WSDL
45
     * - documentation: Businessâs primary telephone number Character length and limitations: 20 alphanumeric characters
46
     * - minOccurs: 0
47
     * @var string
48
     */
49
    public $WorkPhone;
50
    /**
51
     * The Category
52
     * Meta information extracted from the WSDL
53
     * - documentation: Line of business, as defined in the enumerations
54
     * - minOccurs: 0
55
     * @var string
56
     */
57
    public $Category;
58
    /**
59
     * The SubCategory
60
     * Meta information extracted from the WSDL
61
     * - documentation: Business sub-category, as defined in the enumerations
62
     * - minOccurs: 0
63
     * @var string
64
     */
65
    public $SubCategory;
66
    /**
67
     * The AveragePrice
68
     * Meta information extracted from the WSDL
69
     * - documentation: Average transaction price, as defined by the enumerations. Enumeration Meaning AverageTransactionPrice-Not-Applicable AverageTransactionPrice-Range1 Less than $25 USD AverageTransactionPrice-Range2 $25 USD to $50 USD
70
     * AverageTransactionPrice-Range3 $50 USD to $100 USD AverageTransactionPrice-Range4 $100 USD to $250 USD AverageTransactionPrice-Range5 $250 USD to $500 USD AverageTransactionPrice-Range6 $500 USD to $1,000 USD AverageTransactionPrice-Range7 $1,000 USD
71
     * to $2,000 USD AverageTransactionPrice-Range8 $2,000 USD to $5,000 USD AverageTransactionPrice-Range9 $5,000 USD to $10,000 USD AverageTransactionPrice-Range10 More than $10,000 USD
72
     * - minOccurs: 0
73
     * @var string
74
     */
75
    public $AveragePrice;
76
    /**
77
     * The AverageMonthlyVolume
78
     * Meta information extracted from the WSDL
79
     * - documentation: Average monthly sales volume, as defined by the enumerations. Enumeration Meaning AverageMonthlyVolume-Not-Applicable AverageMonthlyVolume-Range1 Less than $1,000 USD AverageMonthlyVolume-Range2 $1,000 USD to $5,000 USD
80
     * AverageMonthlyVolume-Range3 $5,000 USD to $25,000 USD AverageMonthlyVolume-Range4 $25,000 USD to $100,000 USD AverageMonthlyVolume-Range5 $100,000 USD to $1,000,000 USD AverageMonthlyVolume-Range6 More than $1,000,000 USD
81
     * - minOccurs: 0
82
     * @var string
83
     */
84
    public $AverageMonthlyVolume;
85
    /**
86
     * The SalesVenue
87
     * Meta information extracted from the WSDL
88
     * - documentation: Main sales venue, such as eBay
89
     * - minOccurs: 0
90
     * @var string
91
     */
92
    public $SalesVenue;
93
    /**
94
     * The Website
95
     * Meta information extracted from the WSDL
96
     * - documentation: Primary URL of business Character length and limitations: 2,048 alphanumeric characters
97
     * - minOccurs: 0
98
     * @var string
99
     */
100
    public $Website;
101
    /**
102
     * The RevenueFromOnlineSales
103
     * Meta information extracted from the WSDL
104
     * - documentation: Percentage of revenue attributable to online sales, as defined by the enumerations Enumeration Meaning PercentageRevenueFromOnlineSales-Not-Applicable PercentageRevenueFromOnlineSales-Range1 Less than 25%
105
     * PercentageRevenueFromOnlineSales-Range2 25% to 50% PercentageRevenueFromOnlineSales-Range3 50% to 75% PercentageRevenueFromOnlineSales-Range4 75% to 100%
106
     * - minOccurs: 0
107
     * @var string
108
     */
109
    public $RevenueFromOnlineSales;
110
    /**
111
     * The BusinessEstablished
112
     * Meta information extracted from the WSDL
113
     * - documentation: Date the merchantâs business was established
114
     * - minOccurs: 0
115
     * @var string
116
     */
117
    public $BusinessEstablished;
118
    /**
119
     * The CustomerServiceEmail
120
     * Meta information extracted from the WSDL
121
     * - documentation: Email address to contact businessâs customer service Character length and limitations: 127 alphanumeric characters
122
     * - base: xs:string
123
     * - minOccurs: 0
124
     * @var string
125
     */
126
    public $CustomerServiceEmail;
127
    /**
128
     * The CustomerServicePhone
129
     * Meta information extracted from the WSDL
130
     * - documentation: Telephone number to contact businessâs customer service Character length and limitations: 32 alphanumeric characters
131
     * - minOccurs: 0
132
     * @var string
133
     */
134
    public $CustomerServicePhone;
135
    /**
136
     * Constructor method for BusinessInfoType
137
     * @uses BusinessInfoType::setType()
138
     * @uses BusinessInfoType::setName()
139
     * @uses BusinessInfoType::setAddress()
140
     * @uses BusinessInfoType::setWorkPhone()
141
     * @uses BusinessInfoType::setCategory()
142
     * @uses BusinessInfoType::setSubCategory()
143
     * @uses BusinessInfoType::setAveragePrice()
144
     * @uses BusinessInfoType::setAverageMonthlyVolume()
145
     * @uses BusinessInfoType::setSalesVenue()
146
     * @uses BusinessInfoType::setWebsite()
147
     * @uses BusinessInfoType::setRevenueFromOnlineSales()
148
     * @uses BusinessInfoType::setBusinessEstablished()
149
     * @uses BusinessInfoType::setCustomerServiceEmail()
150
     * @uses BusinessInfoType::setCustomerServicePhone()
151
     * @param string $type
152
     * @param string $name
153
     * @param \PayPal\StructType\AddressType $address
154
     * @param string $workPhone
155
     * @param string $category
156
     * @param string $subCategory
157
     * @param string $averagePrice
158
     * @param string $averageMonthlyVolume
159
     * @param string $salesVenue
160
     * @param string $website
161
     * @param string $revenueFromOnlineSales
162
     * @param string $businessEstablished
163
     * @param string $customerServiceEmail
164
     * @param string $customerServicePhone
165
     */
166
    public function __construct($type = null, $name = null, \PayPal\StructType\AddressType $address = null, $workPhone = null, $category = null, $subCategory = null, $averagePrice = null, $averageMonthlyVolume = null, $salesVenue = null, $website = null, $revenueFromOnlineSales = null, $businessEstablished = null, $customerServiceEmail = null, $customerServicePhone = null)
167
    {
168
        $this
169
            ->setType($type)
170
            ->setName($name)
171
            ->setAddress($address)
172
            ->setWorkPhone($workPhone)
173
            ->setCategory($category)
174
            ->setSubCategory($subCategory)
175
            ->setAveragePrice($averagePrice)
176
            ->setAverageMonthlyVolume($averageMonthlyVolume)
177
            ->setSalesVenue($salesVenue)
178
            ->setWebsite($website)
179
            ->setRevenueFromOnlineSales($revenueFromOnlineSales)
180
            ->setBusinessEstablished($businessEstablished)
181
            ->setCustomerServiceEmail($customerServiceEmail)
182
            ->setCustomerServicePhone($customerServicePhone);
183
    }
184
    /**
185
     * Get Type value
186
     * @return string|null
187
     */
188
    public function getType()
189
    {
190
        return $this->Type;
191
    }
192
    /**
193
     * Set Type value
194
     * @uses \PayPal\EnumType\BusinessTypeType::valueIsValid()
195
     * @uses \PayPal\EnumType\BusinessTypeType::getValidValues()
196
     * @throws \InvalidArgumentException
197
     * @param string $type
198
     * @return \PayPal\StructType\BusinessInfoType
199
     */
200
    public function setType($type = null)
201
    {
202
        // validation for constraint: enumeration
203
        if (!\PayPal\EnumType\BusinessTypeType::valueIsValid($type)) {
204
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BusinessTypeType', is_array($type) ? implode(', ', $type) : var_export($type, true), implode(', ', \PayPal\EnumType\BusinessTypeType::getValidValues())), __LINE__);
0 ignored issues
show
introduced by
The condition is_array($type) is always false.
Loading history...
205
        }
206
        $this->Type = $type;
207
        return $this;
208
    }
209
    /**
210
     * Get Name value
211
     * @return string|null
212
     */
213
    public function getName()
214
    {
215
        return $this->Name;
216
    }
217
    /**
218
     * Set Name value
219
     * @param string $name
220
     * @return \PayPal\StructType\BusinessInfoType
221
     */
222
    public function setName($name = null)
223
    {
224
        // validation for constraint: string
225
        if (!is_null($name) && !is_string($name)) {
0 ignored issues
show
introduced by
The condition is_string($name) is always true.
Loading history...
226
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__);
227
        }
228
        // validation for constraint: maxLength(25)
229
        if (!is_null($name) && mb_strlen($name) > 25) {
230
            throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 25', mb_strlen($name)), __LINE__);
231
        }
232
        $this->Name = $name;
233
        return $this;
234
    }
235
    /**
236
     * Get Address value
237
     * @return \PayPal\StructType\AddressType|null
238
     */
239
    public function getAddress()
240
    {
241
        return $this->Address;
242
    }
243
    /**
244
     * Set Address value
245
     * @param \PayPal\StructType\AddressType $address
246
     * @return \PayPal\StructType\BusinessInfoType
247
     */
248
    public function setAddress(\PayPal\StructType\AddressType $address = null)
249
    {
250
        $this->Address = $address;
251
        return $this;
252
    }
253
    /**
254
     * Get WorkPhone value
255
     * @return string|null
256
     */
257
    public function getWorkPhone()
258
    {
259
        return $this->WorkPhone;
260
    }
261
    /**
262
     * Set WorkPhone value
263
     * @param string $workPhone
264
     * @return \PayPal\StructType\BusinessInfoType
265
     */
266
    public function setWorkPhone($workPhone = null)
267
    {
268
        // validation for constraint: string
269
        if (!is_null($workPhone) && !is_string($workPhone)) {
0 ignored issues
show
introduced by
The condition is_string($workPhone) is always true.
Loading history...
270
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($workPhone, true), gettype($workPhone)), __LINE__);
271
        }
272
        $this->WorkPhone = $workPhone;
273
        return $this;
274
    }
275
    /**
276
     * Get Category value
277
     * @return string|null
278
     */
279
    public function getCategory()
280
    {
281
        return $this->Category;
282
    }
283
    /**
284
     * Set Category value
285
     * @uses \PayPal\EnumType\BusinessCategoryType::valueIsValid()
286
     * @uses \PayPal\EnumType\BusinessCategoryType::getValidValues()
287
     * @throws \InvalidArgumentException
288
     * @param string $category
289
     * @return \PayPal\StructType\BusinessInfoType
290
     */
291
    public function setCategory($category = null)
292
    {
293
        // validation for constraint: enumeration
294
        if (!\PayPal\EnumType\BusinessCategoryType::valueIsValid($category)) {
295
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BusinessCategoryType', is_array($category) ? implode(', ', $category) : var_export($category, true), implode(', ', \PayPal\EnumType\BusinessCategoryType::getValidValues())), __LINE__);
0 ignored issues
show
introduced by
The condition is_array($category) is always false.
Loading history...
296
        }
297
        $this->Category = $category;
298
        return $this;
299
    }
300
    /**
301
     * Get SubCategory value
302
     * @return string|null
303
     */
304
    public function getSubCategory()
305
    {
306
        return $this->SubCategory;
307
    }
308
    /**
309
     * Set SubCategory value
310
     * @uses \PayPal\EnumType\BusinessSubCategoryType::valueIsValid()
311
     * @uses \PayPal\EnumType\BusinessSubCategoryType::getValidValues()
312
     * @throws \InvalidArgumentException
313
     * @param string $subCategory
314
     * @return \PayPal\StructType\BusinessInfoType
315
     */
316
    public function setSubCategory($subCategory = null)
317
    {
318
        // validation for constraint: enumeration
319
        if (!\PayPal\EnumType\BusinessSubCategoryType::valueIsValid($subCategory)) {
320
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BusinessSubCategoryType', is_array($subCategory) ? implode(', ', $subCategory) : var_export($subCategory, true), implode(', ', \PayPal\EnumType\BusinessSubCategoryType::getValidValues())), __LINE__);
0 ignored issues
show
introduced by
The condition is_array($subCategory) is always false.
Loading history...
321
        }
322
        $this->SubCategory = $subCategory;
323
        return $this;
324
    }
325
    /**
326
     * Get AveragePrice value
327
     * @return string|null
328
     */
329
    public function getAveragePrice()
330
    {
331
        return $this->AveragePrice;
332
    }
333
    /**
334
     * Set AveragePrice value
335
     * @uses \PayPal\EnumType\AverageTransactionPriceType::valueIsValid()
336
     * @uses \PayPal\EnumType\AverageTransactionPriceType::getValidValues()
337
     * @throws \InvalidArgumentException
338
     * @param string $averagePrice
339
     * @return \PayPal\StructType\BusinessInfoType
340
     */
341
    public function setAveragePrice($averagePrice = null)
342
    {
343
        // validation for constraint: enumeration
344
        if (!\PayPal\EnumType\AverageTransactionPriceType::valueIsValid($averagePrice)) {
345
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AverageTransactionPriceType', is_array($averagePrice) ? implode(', ', $averagePrice) : var_export($averagePrice, true), implode(', ', \PayPal\EnumType\AverageTransactionPriceType::getValidValues())), __LINE__);
0 ignored issues
show
introduced by
The condition is_array($averagePrice) is always false.
Loading history...
346
        }
347
        $this->AveragePrice = $averagePrice;
348
        return $this;
349
    }
350
    /**
351
     * Get AverageMonthlyVolume value
352
     * @return string|null
353
     */
354
    public function getAverageMonthlyVolume()
355
    {
356
        return $this->AverageMonthlyVolume;
357
    }
358
    /**
359
     * Set AverageMonthlyVolume value
360
     * @uses \PayPal\EnumType\AverageMonthlyVolumeType::valueIsValid()
361
     * @uses \PayPal\EnumType\AverageMonthlyVolumeType::getValidValues()
362
     * @throws \InvalidArgumentException
363
     * @param string $averageMonthlyVolume
364
     * @return \PayPal\StructType\BusinessInfoType
365
     */
366
    public function setAverageMonthlyVolume($averageMonthlyVolume = null)
367
    {
368
        // validation for constraint: enumeration
369
        if (!\PayPal\EnumType\AverageMonthlyVolumeType::valueIsValid($averageMonthlyVolume)) {
370
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AverageMonthlyVolumeType', is_array($averageMonthlyVolume) ? implode(', ', $averageMonthlyVolume) : var_export($averageMonthlyVolume, true), implode(', ', \PayPal\EnumType\AverageMonthlyVolumeType::getValidValues())), __LINE__);
0 ignored issues
show
introduced by
The condition is_array($averageMonthlyVolume) is always false.
Loading history...
371
        }
372
        $this->AverageMonthlyVolume = $averageMonthlyVolume;
373
        return $this;
374
    }
375
    /**
376
     * Get SalesVenue value
377
     * @return string|null
378
     */
379
    public function getSalesVenue()
380
    {
381
        return $this->SalesVenue;
382
    }
383
    /**
384
     * Set SalesVenue value
385
     * @uses \PayPal\EnumType\SalesVenueType::valueIsValid()
386
     * @uses \PayPal\EnumType\SalesVenueType::getValidValues()
387
     * @throws \InvalidArgumentException
388
     * @param string $salesVenue
389
     * @return \PayPal\StructType\BusinessInfoType
390
     */
391
    public function setSalesVenue($salesVenue = null)
392
    {
393
        // validation for constraint: enumeration
394
        if (!\PayPal\EnumType\SalesVenueType::valueIsValid($salesVenue)) {
395
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\SalesVenueType', is_array($salesVenue) ? implode(', ', $salesVenue) : var_export($salesVenue, true), implode(', ', \PayPal\EnumType\SalesVenueType::getValidValues())), __LINE__);
0 ignored issues
show
introduced by
The condition is_array($salesVenue) is always false.
Loading history...
396
        }
397
        $this->SalesVenue = $salesVenue;
398
        return $this;
399
    }
400
    /**
401
     * Get Website value
402
     * @return string|null
403
     */
404
    public function getWebsite()
405
    {
406
        return $this->Website;
407
    }
408
    /**
409
     * Set Website value
410
     * @param string $website
411
     * @return \PayPal\StructType\BusinessInfoType
412
     */
413
    public function setWebsite($website = null)
414
    {
415
        // validation for constraint: string
416
        if (!is_null($website) && !is_string($website)) {
0 ignored issues
show
introduced by
The condition is_string($website) is always true.
Loading history...
417
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($website, true), gettype($website)), __LINE__);
418
        }
419
        $this->Website = $website;
420
        return $this;
421
    }
422
    /**
423
     * Get RevenueFromOnlineSales value
424
     * @return string|null
425
     */
426
    public function getRevenueFromOnlineSales()
427
    {
428
        return $this->RevenueFromOnlineSales;
429
    }
430
    /**
431
     * Set RevenueFromOnlineSales value
432
     * @uses \PayPal\EnumType\PercentageRevenueFromOnlineSalesType::valueIsValid()
433
     * @uses \PayPal\EnumType\PercentageRevenueFromOnlineSalesType::getValidValues()
434
     * @throws \InvalidArgumentException
435
     * @param string $revenueFromOnlineSales
436
     * @return \PayPal\StructType\BusinessInfoType
437
     */
438
    public function setRevenueFromOnlineSales($revenueFromOnlineSales = null)
439
    {
440
        // validation for constraint: enumeration
441
        if (!\PayPal\EnumType\PercentageRevenueFromOnlineSalesType::valueIsValid($revenueFromOnlineSales)) {
442
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PercentageRevenueFromOnlineSalesType', is_array($revenueFromOnlineSales) ? implode(', ', $revenueFromOnlineSales) : var_export($revenueFromOnlineSales, true), implode(', ', \PayPal\EnumType\PercentageRevenueFromOnlineSalesType::getValidValues())), __LINE__);
0 ignored issues
show
introduced by
The condition is_array($revenueFromOnlineSales) is always false.
Loading history...
443
        }
444
        $this->RevenueFromOnlineSales = $revenueFromOnlineSales;
445
        return $this;
446
    }
447
    /**
448
     * Get BusinessEstablished value
449
     * @return string|null
450
     */
451
    public function getBusinessEstablished()
452
    {
453
        return $this->BusinessEstablished;
454
    }
455
    /**
456
     * Set BusinessEstablished value
457
     * @param string $businessEstablished
458
     * @return \PayPal\StructType\BusinessInfoType
459
     */
460
    public function setBusinessEstablished($businessEstablished = null)
461
    {
462
        // validation for constraint: string
463
        if (!is_null($businessEstablished) && !is_string($businessEstablished)) {
0 ignored issues
show
introduced by
The condition is_string($businessEstablished) is always true.
Loading history...
464
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($businessEstablished, true), gettype($businessEstablished)), __LINE__);
465
        }
466
        $this->BusinessEstablished = $businessEstablished;
467
        return $this;
468
    }
469
    /**
470
     * Get CustomerServiceEmail value
471
     * @return string|null
472
     */
473
    public function getCustomerServiceEmail()
474
    {
475
        return $this->CustomerServiceEmail;
476
    }
477
    /**
478
     * Set CustomerServiceEmail value
479
     * @param string $customerServiceEmail
480
     * @return \PayPal\StructType\BusinessInfoType
481
     */
482
    public function setCustomerServiceEmail($customerServiceEmail = null)
483
    {
484
        // validation for constraint: string
485
        if (!is_null($customerServiceEmail) && !is_string($customerServiceEmail)) {
0 ignored issues
show
introduced by
The condition is_string($customerServiceEmail) is always true.
Loading history...
486
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($customerServiceEmail, true), gettype($customerServiceEmail)), __LINE__);
487
        }
488
        $this->CustomerServiceEmail = $customerServiceEmail;
489
        return $this;
490
    }
491
    /**
492
     * Get CustomerServicePhone value
493
     * @return string|null
494
     */
495
    public function getCustomerServicePhone()
496
    {
497
        return $this->CustomerServicePhone;
498
    }
499
    /**
500
     * Set CustomerServicePhone value
501
     * @param string $customerServicePhone
502
     * @return \PayPal\StructType\BusinessInfoType
503
     */
504
    public function setCustomerServicePhone($customerServicePhone = null)
505
    {
506
        // validation for constraint: string
507
        if (!is_null($customerServicePhone) && !is_string($customerServicePhone)) {
0 ignored issues
show
introduced by
The condition is_string($customerServicePhone) is always true.
Loading history...
508
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($customerServicePhone, true), gettype($customerServicePhone)), __LINE__);
509
        }
510
        $this->CustomerServicePhone = $customerServicePhone;
511
        return $this;
512
    }
513
}
514