Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
| 1 | <?php |
||
| 7 | class Captures extends CapturesBase |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Sets the 'touch_identifier' parameter. |
||
| 11 | * |
||
| 12 | * @param string $touchIdentifier Internal identifier for the touch, if this field is left empty, lift will |
||
| 13 | * generate a touch identifier and include it in the response |
||
| 14 | * |
||
| 15 | * @throws \Acquia\LiftClient\Exception\LiftSdkException |
||
| 16 | * |
||
| 17 | * @return \Acquia\LiftClient\Entity\Captures |
||
| 18 | */ |
||
| 19 | public function setTouchIdentifier($touchIdentifier) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Sets the 'identity' parameter. |
||
| 31 | * |
||
| 32 | * @param string $identity Visitor's primary identity information |
||
| 33 | * |
||
| 34 | * @throws \Acquia\LiftClient\Exception\LiftSdkException |
||
| 35 | * |
||
| 36 | * @return \Acquia\LiftClient\Entity\Captures |
||
| 37 | */ |
||
| 38 | public function setIdentity($identity) |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Sets the 'identity_source' parameter. |
||
| 50 | * |
||
| 51 | * @param string $identitySource Type of visitor's primary identity information. Specific string (account, email, |
||
| 52 | * facebook, twitter, tracking, name) or custom identifier type |
||
| 53 | * |
||
| 54 | * @throws \Acquia\LiftClient\Exception\LiftSdkException |
||
| 55 | * |
||
| 56 | * @return \Acquia\LiftClient\Entity\Captures |
||
| 57 | */ |
||
| 58 | public function setIdentitySource($identitySource) |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Sets the 'do_not_track' parameter. |
||
| 70 | * |
||
| 71 | * @param bool $doNotTrack Flag to indicate whether the person should not be tracked |
||
| 72 | * |
||
| 73 | * @throws \Acquia\LiftClient\Exception\LiftSdkException |
||
| 74 | * |
||
| 75 | * @return \Acquia\LiftClient\Entity\Captures |
||
| 76 | */ |
||
| 77 | public function setDoNotTrack($doNotTrack) |
||
| 86 | |||
| 87 | /** |
||
| 88 | * Sets the 'return_segments' parameter. |
||
| 89 | * |
||
| 90 | * @param bool $returnSegments Flag to indicate whether the person should not be tracked |
||
| 91 | * |
||
| 92 | * @throws \Acquia\LiftClient\Exception\LiftSdkException |
||
| 93 | * |
||
| 94 | * @return \Acquia\LiftClient\Entity\Captures |
||
| 95 | */ |
||
| 96 | public function setReturnSegments($returnSegments) |
||
| 105 | |||
| 106 | /** |
||
| 107 | * Sets the 'site_id' parameter. |
||
| 108 | * |
||
| 109 | * @param string $siteId The customer site matching external_site_id in the configuration database. Used for |
||
| 110 | * filtering segments to evaluate and the default site_id for captures. If not specified then |
||
| 111 | * the last capture is used to calculate the site_id for filtering segments |
||
| 112 | * |
||
| 113 | * @throws \Acquia\LiftClient\Exception\LiftSdkException |
||
| 114 | * |
||
| 115 | * @return \Acquia\LiftClient\Entity\Captures |
||
| 116 | */ |
||
| 117 | View Code Duplication | public function setSiteId($siteId) |
|
| 126 | |||
| 127 | /** |
||
| 128 | * Sets the 'captures' parameter. |
||
| 129 | * |
||
| 130 | * @param Capture[] $captures List of captures |
||
| 131 | * |
||
| 132 | * @throws \Acquia\LiftClient\Exception\LiftSdkException |
||
| 133 | * |
||
| 134 | * @return \Acquia\LiftClient\Entity\Captures |
||
| 135 | */ |
||
| 136 | public function setCaptures($captures) |
||
| 145 | } |
||
| 146 |