Total Complexity | 49 |
Total Lines | 596 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
Complex classes like GetUserInfoResult 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 GetUserInfoResult, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
5 | class GetUserInfoResult |
||
6 | { |
||
7 | /** |
||
8 | * @var boolean |
||
9 | */ |
||
10 | protected $accessibilityMode = null; |
||
11 | |||
12 | /** |
||
13 | * @var boolean |
||
14 | */ |
||
15 | protected $chatterExternal = null; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $currencySymbol = null; |
||
21 | |||
22 | /** |
||
23 | * @var int |
||
24 | */ |
||
25 | protected $orgAttachmentFileSizeLimit = null; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $orgDefaultCurrencyIsoCode = null; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $orgDefaultCurrencyLocale = null; |
||
36 | |||
37 | /** |
||
38 | * @var boolean |
||
39 | */ |
||
40 | protected $orgDisallowHtmlAttachments = null; |
||
41 | |||
42 | /** |
||
43 | * @var boolean |
||
44 | */ |
||
45 | protected $orgHasPersonAccounts = null; |
||
46 | |||
47 | /** |
||
48 | * @var ID |
||
49 | */ |
||
50 | protected $organizationId = null; |
||
51 | |||
52 | /** |
||
53 | * @var boolean |
||
54 | */ |
||
55 | protected $organizationMultiCurrency = null; |
||
56 | |||
57 | /** |
||
58 | * @var string |
||
59 | */ |
||
60 | protected $organizationName = null; |
||
61 | |||
62 | /** |
||
63 | * @var ID |
||
64 | */ |
||
65 | protected $profileId = null; |
||
66 | |||
67 | /** |
||
68 | * @var ID |
||
69 | */ |
||
70 | protected $roleId = null; |
||
71 | |||
72 | /** |
||
73 | * @var int |
||
74 | */ |
||
75 | protected $sessionSecondsValid = null; |
||
76 | |||
77 | /** |
||
78 | * @var string |
||
79 | */ |
||
80 | protected $userDefaultCurrencyIsoCode = null; |
||
81 | |||
82 | /** |
||
83 | * @var string |
||
84 | */ |
||
85 | protected $userEmail = null; |
||
86 | |||
87 | /** |
||
88 | * @var string |
||
89 | */ |
||
90 | protected $userFullName = null; |
||
91 | |||
92 | /** |
||
93 | * @var ID |
||
94 | */ |
||
95 | protected $userId = null; |
||
96 | |||
97 | /** |
||
98 | * @var string |
||
99 | */ |
||
100 | protected $userLanguage = null; |
||
101 | |||
102 | /** |
||
103 | * @var string |
||
104 | */ |
||
105 | protected $userLocale = null; |
||
106 | |||
107 | /** |
||
108 | * @var string |
||
109 | */ |
||
110 | protected $userName = null; |
||
111 | |||
112 | /** |
||
113 | * @var string |
||
114 | */ |
||
115 | protected $userTimeZone = null; |
||
116 | |||
117 | /** |
||
118 | * @var string |
||
119 | */ |
||
120 | protected $userType = null; |
||
121 | |||
122 | /** |
||
123 | * @var string |
||
124 | */ |
||
125 | protected $userUiSkin = null; |
||
126 | |||
127 | /** |
||
128 | * @param boolean $accessibilityMode |
||
129 | * @param boolean $chatterExternal |
||
130 | * @param int $orgAttachmentFileSizeLimit |
||
131 | * @param boolean $orgDisallowHtmlAttachments |
||
132 | * @param boolean $orgHasPersonAccounts |
||
133 | * @param ID $organizationId |
||
134 | * @param boolean $organizationMultiCurrency |
||
135 | * @param string $organizationName |
||
136 | * @param ID $profileId |
||
137 | * @param int $sessionSecondsValid |
||
138 | * @param string $userEmail |
||
139 | * @param string $userFullName |
||
140 | * @param ID $userId |
||
141 | * @param string $userLanguage |
||
142 | * @param string $userLocale |
||
143 | * @param string $userName |
||
144 | * @param string $userTimeZone |
||
145 | * @param string $userType |
||
146 | * @param string $userUiSkin |
||
147 | */ |
||
148 | public function __construct($accessibilityMode = null, $chatterExternal = null, $orgAttachmentFileSizeLimit = null, $orgDisallowHtmlAttachments = null, $orgHasPersonAccounts = null, $organizationId = null, $organizationMultiCurrency = null, $organizationName = null, $profileId = null, $sessionSecondsValid = null, $userEmail = null, $userFullName = null, $userId = null, $userLanguage = null, $userLocale = null, $userName = null, $userTimeZone = null, $userType = null, $userUiSkin = null) |
||
149 | { |
||
150 | $this->accessibilityMode = $accessibilityMode; |
||
151 | $this->chatterExternal = $chatterExternal; |
||
152 | $this->orgAttachmentFileSizeLimit = $orgAttachmentFileSizeLimit; |
||
153 | $this->orgDisallowHtmlAttachments = $orgDisallowHtmlAttachments; |
||
154 | $this->orgHasPersonAccounts = $orgHasPersonAccounts; |
||
155 | $this->organizationId = $organizationId; |
||
156 | $this->organizationMultiCurrency = $organizationMultiCurrency; |
||
157 | $this->organizationName = $organizationName; |
||
158 | $this->profileId = $profileId; |
||
159 | $this->sessionSecondsValid = $sessionSecondsValid; |
||
160 | $this->userEmail = $userEmail; |
||
161 | $this->userFullName = $userFullName; |
||
162 | $this->userId = $userId; |
||
163 | $this->userLanguage = $userLanguage; |
||
164 | $this->userLocale = $userLocale; |
||
165 | $this->userName = $userName; |
||
166 | $this->userTimeZone = $userTimeZone; |
||
167 | $this->userType = $userType; |
||
168 | $this->userUiSkin = $userUiSkin; |
||
169 | } |
||
170 | |||
171 | /** |
||
172 | * @return boolean |
||
173 | */ |
||
174 | public function getAccessibilityMode() |
||
175 | { |
||
176 | return $this->accessibilityMode; |
||
177 | } |
||
178 | |||
179 | /** |
||
180 | * @param boolean $accessibilityMode |
||
181 | * @return \SForce\Wsdl\GetUserInfoResult |
||
182 | */ |
||
183 | public function setAccessibilityMode($accessibilityMode) |
||
184 | { |
||
185 | $this->accessibilityMode = $accessibilityMode; |
||
186 | return $this; |
||
187 | } |
||
188 | |||
189 | /** |
||
190 | * @return boolean |
||
191 | */ |
||
192 | public function getChatterExternal() |
||
193 | { |
||
194 | return $this->chatterExternal; |
||
195 | } |
||
196 | |||
197 | /** |
||
198 | * @param boolean $chatterExternal |
||
199 | * @return \SForce\Wsdl\GetUserInfoResult |
||
200 | */ |
||
201 | public function setChatterExternal($chatterExternal) |
||
202 | { |
||
203 | $this->chatterExternal = $chatterExternal; |
||
204 | return $this; |
||
205 | } |
||
206 | |||
207 | /** |
||
208 | * @return string |
||
209 | */ |
||
210 | public function getCurrencySymbol() |
||
211 | { |
||
212 | return $this->currencySymbol; |
||
213 | } |
||
214 | |||
215 | /** |
||
216 | * @param string $currencySymbol |
||
217 | * @return \SForce\Wsdl\GetUserInfoResult |
||
218 | */ |
||
219 | public function setCurrencySymbol($currencySymbol) |
||
220 | { |
||
221 | $this->currencySymbol = $currencySymbol; |
||
222 | return $this; |
||
223 | } |
||
224 | |||
225 | /** |
||
226 | * @return int |
||
227 | */ |
||
228 | public function getOrgAttachmentFileSizeLimit() |
||
229 | { |
||
230 | return $this->orgAttachmentFileSizeLimit; |
||
231 | } |
||
232 | |||
233 | /** |
||
234 | * @param int $orgAttachmentFileSizeLimit |
||
235 | * @return \SForce\Wsdl\GetUserInfoResult |
||
236 | */ |
||
237 | public function setOrgAttachmentFileSizeLimit($orgAttachmentFileSizeLimit) |
||
238 | { |
||
239 | $this->orgAttachmentFileSizeLimit = $orgAttachmentFileSizeLimit; |
||
240 | return $this; |
||
241 | } |
||
242 | |||
243 | /** |
||
244 | * @return string |
||
245 | */ |
||
246 | public function getOrgDefaultCurrencyIsoCode() |
||
247 | { |
||
248 | return $this->orgDefaultCurrencyIsoCode; |
||
249 | } |
||
250 | |||
251 | /** |
||
252 | * @param string $orgDefaultCurrencyIsoCode |
||
253 | * @return \SForce\Wsdl\GetUserInfoResult |
||
254 | */ |
||
255 | public function setOrgDefaultCurrencyIsoCode($orgDefaultCurrencyIsoCode) |
||
256 | { |
||
257 | $this->orgDefaultCurrencyIsoCode = $orgDefaultCurrencyIsoCode; |
||
258 | return $this; |
||
259 | } |
||
260 | |||
261 | /** |
||
262 | * @return string |
||
263 | */ |
||
264 | public function getOrgDefaultCurrencyLocale() |
||
265 | { |
||
266 | return $this->orgDefaultCurrencyLocale; |
||
267 | } |
||
268 | |||
269 | /** |
||
270 | * @param string $orgDefaultCurrencyLocale |
||
271 | * @return \SForce\Wsdl\GetUserInfoResult |
||
272 | */ |
||
273 | public function setOrgDefaultCurrencyLocale($orgDefaultCurrencyLocale) |
||
274 | { |
||
275 | $this->orgDefaultCurrencyLocale = $orgDefaultCurrencyLocale; |
||
276 | return $this; |
||
277 | } |
||
278 | |||
279 | /** |
||
280 | * @return boolean |
||
281 | */ |
||
282 | public function getOrgDisallowHtmlAttachments() |
||
283 | { |
||
284 | return $this->orgDisallowHtmlAttachments; |
||
285 | } |
||
286 | |||
287 | /** |
||
288 | * @param boolean $orgDisallowHtmlAttachments |
||
289 | * @return \SForce\Wsdl\GetUserInfoResult |
||
290 | */ |
||
291 | public function setOrgDisallowHtmlAttachments($orgDisallowHtmlAttachments) |
||
292 | { |
||
293 | $this->orgDisallowHtmlAttachments = $orgDisallowHtmlAttachments; |
||
294 | return $this; |
||
295 | } |
||
296 | |||
297 | /** |
||
298 | * @return boolean |
||
299 | */ |
||
300 | public function getOrgHasPersonAccounts() |
||
301 | { |
||
302 | return $this->orgHasPersonAccounts; |
||
303 | } |
||
304 | |||
305 | /** |
||
306 | * @param boolean $orgHasPersonAccounts |
||
307 | * @return \SForce\Wsdl\GetUserInfoResult |
||
308 | */ |
||
309 | public function setOrgHasPersonAccounts($orgHasPersonAccounts) |
||
310 | { |
||
311 | $this->orgHasPersonAccounts = $orgHasPersonAccounts; |
||
312 | return $this; |
||
313 | } |
||
314 | |||
315 | /** |
||
316 | * @return ID |
||
317 | */ |
||
318 | public function getOrganizationId() |
||
319 | { |
||
320 | return $this->organizationId; |
||
321 | } |
||
322 | |||
323 | /** |
||
324 | * @param ID $organizationId |
||
325 | * @return \SForce\Wsdl\GetUserInfoResult |
||
326 | */ |
||
327 | public function setOrganizationId($organizationId) |
||
328 | { |
||
329 | $this->organizationId = $organizationId; |
||
330 | return $this; |
||
331 | } |
||
332 | |||
333 | /** |
||
334 | * @return boolean |
||
335 | */ |
||
336 | public function getOrganizationMultiCurrency() |
||
337 | { |
||
338 | return $this->organizationMultiCurrency; |
||
339 | } |
||
340 | |||
341 | /** |
||
342 | * @param boolean $organizationMultiCurrency |
||
343 | * @return \SForce\Wsdl\GetUserInfoResult |
||
344 | */ |
||
345 | public function setOrganizationMultiCurrency($organizationMultiCurrency) |
||
346 | { |
||
347 | $this->organizationMultiCurrency = $organizationMultiCurrency; |
||
348 | return $this; |
||
349 | } |
||
350 | |||
351 | /** |
||
352 | * @return string |
||
353 | */ |
||
354 | public function getOrganizationName() |
||
355 | { |
||
356 | return $this->organizationName; |
||
357 | } |
||
358 | |||
359 | /** |
||
360 | * @param string $organizationName |
||
361 | * @return \SForce\Wsdl\GetUserInfoResult |
||
362 | */ |
||
363 | public function setOrganizationName($organizationName) |
||
364 | { |
||
365 | $this->organizationName = $organizationName; |
||
366 | return $this; |
||
367 | } |
||
368 | |||
369 | /** |
||
370 | * @return ID |
||
371 | */ |
||
372 | public function getProfileId() |
||
373 | { |
||
374 | return $this->profileId; |
||
375 | } |
||
376 | |||
377 | /** |
||
378 | * @param ID $profileId |
||
379 | * @return \SForce\Wsdl\GetUserInfoResult |
||
380 | */ |
||
381 | public function setProfileId($profileId) |
||
385 | } |
||
386 | |||
387 | /** |
||
388 | * @return ID |
||
389 | */ |
||
390 | public function getRoleId() |
||
391 | { |
||
392 | return $this->roleId; |
||
393 | } |
||
394 | |||
395 | /** |
||
396 | * @param ID $roleId |
||
397 | * @return \SForce\Wsdl\GetUserInfoResult |
||
398 | */ |
||
399 | public function setRoleId($roleId) |
||
400 | { |
||
401 | $this->roleId = $roleId; |
||
402 | return $this; |
||
403 | } |
||
404 | |||
405 | /** |
||
406 | * @return int |
||
407 | */ |
||
408 | public function getSessionSecondsValid() |
||
409 | { |
||
410 | return $this->sessionSecondsValid; |
||
411 | } |
||
412 | |||
413 | /** |
||
414 | * @param int $sessionSecondsValid |
||
415 | * @return \SForce\Wsdl\GetUserInfoResult |
||
416 | */ |
||
417 | public function setSessionSecondsValid($sessionSecondsValid) |
||
418 | { |
||
419 | $this->sessionSecondsValid = $sessionSecondsValid; |
||
420 | return $this; |
||
421 | } |
||
422 | |||
423 | /** |
||
424 | * @return string |
||
425 | */ |
||
426 | public function getUserDefaultCurrencyIsoCode() |
||
427 | { |
||
428 | return $this->userDefaultCurrencyIsoCode; |
||
429 | } |
||
430 | |||
431 | /** |
||
432 | * @param string $userDefaultCurrencyIsoCode |
||
433 | * @return \SForce\Wsdl\GetUserInfoResult |
||
434 | */ |
||
435 | public function setUserDefaultCurrencyIsoCode($userDefaultCurrencyIsoCode) |
||
436 | { |
||
437 | $this->userDefaultCurrencyIsoCode = $userDefaultCurrencyIsoCode; |
||
438 | return $this; |
||
439 | } |
||
440 | |||
441 | /** |
||
442 | * @return string |
||
443 | */ |
||
444 | public function getUserEmail() |
||
445 | { |
||
446 | return $this->userEmail; |
||
447 | } |
||
448 | |||
449 | /** |
||
450 | * @param string $userEmail |
||
451 | * @return \SForce\Wsdl\GetUserInfoResult |
||
452 | */ |
||
453 | public function setUserEmail($userEmail) |
||
454 | { |
||
455 | $this->userEmail = $userEmail; |
||
456 | return $this; |
||
457 | } |
||
458 | |||
459 | /** |
||
460 | * @return string |
||
461 | */ |
||
462 | public function getUserFullName() |
||
463 | { |
||
464 | return $this->userFullName; |
||
465 | } |
||
466 | |||
467 | /** |
||
468 | * @param string $userFullName |
||
469 | * @return \SForce\Wsdl\GetUserInfoResult |
||
470 | */ |
||
471 | public function setUserFullName($userFullName) |
||
472 | { |
||
473 | $this->userFullName = $userFullName; |
||
474 | return $this; |
||
475 | } |
||
476 | |||
477 | /** |
||
478 | * @return ID |
||
479 | */ |
||
480 | public function getUserId() |
||
481 | { |
||
482 | return $this->userId; |
||
483 | } |
||
484 | |||
485 | /** |
||
486 | * @param ID $userId |
||
487 | * @return \SForce\Wsdl\GetUserInfoResult |
||
488 | */ |
||
489 | public function setUserId($userId) |
||
490 | { |
||
491 | $this->userId = $userId; |
||
492 | return $this; |
||
493 | } |
||
494 | |||
495 | /** |
||
496 | * @return string |
||
497 | */ |
||
498 | public function getUserLanguage() |
||
499 | { |
||
500 | return $this->userLanguage; |
||
501 | } |
||
502 | |||
503 | /** |
||
504 | * @param string $userLanguage |
||
505 | * @return \SForce\Wsdl\GetUserInfoResult |
||
506 | */ |
||
507 | public function setUserLanguage($userLanguage) |
||
508 | { |
||
509 | $this->userLanguage = $userLanguage; |
||
510 | return $this; |
||
511 | } |
||
512 | |||
513 | /** |
||
514 | * @return string |
||
515 | */ |
||
516 | public function getUserLocale() |
||
517 | { |
||
518 | return $this->userLocale; |
||
519 | } |
||
520 | |||
521 | /** |
||
522 | * @param string $userLocale |
||
523 | * @return \SForce\Wsdl\GetUserInfoResult |
||
524 | */ |
||
525 | public function setUserLocale($userLocale) |
||
526 | { |
||
527 | $this->userLocale = $userLocale; |
||
528 | return $this; |
||
529 | } |
||
530 | |||
531 | /** |
||
532 | * @return string |
||
533 | */ |
||
534 | public function getUserName() |
||
535 | { |
||
536 | return $this->userName; |
||
537 | } |
||
538 | |||
539 | /** |
||
540 | * @param string $userName |
||
541 | * @return \SForce\Wsdl\GetUserInfoResult |
||
542 | */ |
||
543 | public function setUserName($userName) |
||
544 | { |
||
545 | $this->userName = $userName; |
||
546 | return $this; |
||
547 | } |
||
548 | |||
549 | /** |
||
550 | * @return string |
||
551 | */ |
||
552 | public function getUserTimeZone() |
||
553 | { |
||
554 | return $this->userTimeZone; |
||
555 | } |
||
556 | |||
557 | /** |
||
558 | * @param string $userTimeZone |
||
559 | * @return \SForce\Wsdl\GetUserInfoResult |
||
560 | */ |
||
561 | public function setUserTimeZone($userTimeZone) |
||
562 | { |
||
563 | $this->userTimeZone = $userTimeZone; |
||
564 | return $this; |
||
565 | } |
||
566 | |||
567 | /** |
||
568 | * @return string |
||
569 | */ |
||
570 | public function getUserType() |
||
571 | { |
||
572 | return $this->userType; |
||
573 | } |
||
574 | |||
575 | /** |
||
576 | * @param string $userType |
||
577 | * @return \SForce\Wsdl\GetUserInfoResult |
||
578 | */ |
||
579 | public function setUserType($userType) |
||
583 | } |
||
584 | |||
585 | /** |
||
586 | * @return string |
||
587 | */ |
||
588 | public function getUserUiSkin() |
||
589 | { |
||
590 | return $this->userUiSkin; |
||
591 | } |
||
592 | |||
593 | /** |
||
594 | * @param string $userUiSkin |
||
595 | * @return \SForce\Wsdl\GetUserInfoResult |
||
596 | */ |
||
597 | public function setUserUiSkin($userUiSkin) |
||
598 | { |
||
599 | $this->userUiSkin = $userUiSkin; |
||
600 | return $this; |
||
601 | } |
||
602 | } |
||
603 |