Code Duplication    Length = 19-20 lines in 2 locations

src/Cpanel.php 2 locations

@@ 146-164 (lines=19) @@
143
		return $this->get("XMLtransfer.cgi", $args);
144
	}
145
146
	public function requestTransfer($args) {
147
		if (!array_key_exists("ip", $args) || !array_key_exists("groupid", $args) || !array_key_exists("packagegroup", $args)) {
148
			error_log("cpanelLicensing::requestTransfer requires that ip, groupid and packageid elements exist in the array passed to it");
149
			return;
150
		}
151
		if (!$this->validateID($args["groupid"])) {
152
			error_log("The groupid passed to cpanelLicensing::requestTransfer is invalid");
153
			return;
154
		}
155
		if (!$this->validateID($args["packageid"])) {
156
			error_log("The package id passed to cpanelLicensing::requestTransfer is invalid");
157
			return;
158
		}
159
		if (!$this->validateIP($args['ip'])) {
160
			error_log("the ip passed to cpanelLicensing::requestTransfer was invalid");
161
			return;
162
		}
163
		return $this->get("XMLtransferRequest.cgi", $args);
164
	}
165
166
	public function activateLicense($args) {
167
		if (!array_key_exists("ip", $args) || !array_key_exists("groupid", $args) || !array_key_exists("packageid", $args)) {
@@ 166-185 (lines=20) @@
163
		return $this->get("XMLtransferRequest.cgi", $args);
164
	}
165
166
	public function activateLicense($args) {
167
		if (!array_key_exists("ip", $args) || !array_key_exists("groupid", $args) || !array_key_exists("packageid", $args)) {
168
			error_log("cpanelLicensing::activateLicense requires that ip, groupid and packageid elements exist in the array passed to it");
169
			return;
170
		}
171
		if (!$this->validateID($args['groupid'])) {
172
			error_log("cpanelLicensing::acivateLicense was passed an invalid groupid");
173
			return;
174
		}
175
		if (!$this->validateIP($args['ip'])) {
176
			error_log("cpanelLicensing::activateLicense was passed an invalid IP");
177
			return;
178
		}
179
		if (!$this->validateID($args['packageid'])) {
180
			error_log("cpanelLicensing::activateLicense was passed an invalid packageid");
181
			return;
182
		}
183
		$args['legal'] = 1;
184
		return $this->get("XMLlicenseAdd.cgi", $args);
185
	}
186
187
	public function addPickupPass($args) {
188
		if (!array_key_exists("pickup", $args)) {