Code Duplication    Length = 11-12 lines in 3 locations

src/Cpanel.php 3 locations

@@ 136-146 (lines=11) @@
133
		return $this->get("XMLonetimeext.cgi", $args);
134
	}
135
136
	public function changeip($args) {
137
		if (!array_key_exists("oldip", $args) || !array_key_exists("newip", $args)) {
138
			error_log("cpanelLicensing::changeip requires that oldip and newip elements exist in the array passed to it");
139
			return;
140
		}
141
		if (!$this->validateIP($args["newip"])) {
142
			error_log("the newip passed to cpanelLicensing::changeip was invalid");
143
			return;
144
		}
145
		return $this->get("XMLtransfer.cgi", $args);
146
	}
147
148
	public function requestTransfer($args) {
149
		if (!array_key_exists("ip", $args) || !array_key_exists("groupid", $args) || !array_key_exists("packagegroup", $args)) {
@@ 233-244 (lines=12) @@
230
		return $this->get("XMLsecverify.cgi", $args);
231
	}
232
233
	public function fetchLicenseRaw($args) {
234
		$args = array_merge(array("all" => 1), $args);
235
		if (!array_key_exists("ip", $args)) {
236
			error_log("cpanelLicesning::fetchLicenseRaw requires that ip exists as an element in the array is passed to it");
237
			return;
238
		}
239
		if (!$this->validateIP($args['ip'])) {
240
			error_log("cpanelLicensing::fetchLicenseRaw was passed an invalid ip");
241
			return;
242
		}
243
		return $this->get("XMLRawlookup.cgi", $args);
244
	}
245
246
	public function fetchLicenseId($args) {
247
		$args = array_merge(array("all" => 1), $args);
@@ 246-257 (lines=12) @@
243
		return $this->get("XMLRawlookup.cgi", $args);
244
	}
245
246
	public function fetchLicenseId($args) {
247
		$args = array_merge(array("all" => 1), $args);
248
		if (!array_key_exists('ip', $args)) {
249
			error_log("cpanelLicensing::getLicenseId requires that an IP is passed to it");
250
			return;
251
		}
252
		if (!$this->validateIP($args['ip'])) {
253
			error_log("cpanelLicensing::fetchLicenseId was passed an invalid ip");
254
			return;
255
		}
256
		return $this->get("XMLlookup.cgi", $args);
257
	}
258
259
	public function fetchPackages() {
260
		return $this->get("XMLpackageInfo.cgi");