Code Duplication    Length = 20-22 lines in 3 locations

src/Dataslang/DataslangApi.php 3 locations

@@ 15-35 (lines=21) @@
12
	private $settings = array();
13
	private $timeout = 7;
14
15
	public function validate($xml, $xsd){
16
		$result = null;
17
18
		try {
19
			
20
			$client = $this->getClient();
21
			$response = $client->request('POST', '/xml/validate', [
22
				'form_params' => [
23
					'xml' => urlencode($xml),
24
					'xsd' => urlencode($xsd)
25
				]
26
			]);
27
			
28
			$result = $response->getBody();
29
			
30
		} catch (\Exception $e) {
31
32
		}
33
		
34
		return $result;
35
  	}
36
  	
37
  	public function transformToXml($xml){
38
  		$result = null;
@@ 37-56 (lines=20) @@
34
		return $result;
35
  	}
36
  	
37
  	public function transformToXml($xml){
38
  		$result = null;
39
  		
40
  		try {
41
  				
42
  			$client = $this->getClient();
43
  			$response = $client->request('POST', '/xml/transform/xml', [
44
  				'form_params' => [
45
  					'xml' => urlencode($xml)
46
  				]
47
  			]);
48
  				
49
  			$result = $response->getBody();
50
  				
51
  		} catch (\Exception $e) {
52
53
  		}
54
  		
55
  		return $result;
56
  	}
57
  	
58
  	public function transformToHtml($xml, $xsl, $dest_path){
59
  		$result = null;
@@ 58-79 (lines=22) @@
55
  		return $result;
56
  	}
57
  	
58
  	public function transformToHtml($xml, $xsl, $dest_path){
59
  		$result = null;
60
  		
61
  		try {
62
  		
63
  			$client = $this->getClient();
64
  			$response = $client->request('POST', '/xml/transform/html', [
65
				'form_params' => [
66
					'xml' => urlencode($xml),
67
					'xsl' => urlencode($xsl),
68
					'dest_path' => urlencode($dest_path)
69
				]
70
  			]);
71
  		
72
  			$result = $response->getBody();
73
  		
74
  		} catch (\Exception $e) {
75
76
  		}
77
  		
78
  		return $result;
79
  	}
80
  
81
	public function setTimeout($timeout){
82
		$this->timeout = $timeout;