| @@ -6,63 +6,63 @@ | ||
| 6 | 6 | |
| 7 | 7 |  class DataslangApi { | 
| 8 | 8 | |
| 9 | - const BASE_URI = 'http://api.dataslang.com'; | |
| 9 | + const BASE_URI = 'http://api.dataslang.com'; | |
| 10 | 10 | |
| 11 | - private $client = null; | |
| 12 | - private $settings = array(); | |
| 13 | - private $timeout = 2.0; | |
| 11 | + private $client = null; | |
| 12 | + private $settings = array(); | |
| 13 | + private $timeout = 2.0; | |
| 14 | 14 | |
| 15 | -	public function __construct(){ | |
| 16 | - $this->initSettings(); | |
| 17 | - $this->client = new Client($this->settings); | |
| 18 | - } | |
| 15 | +    public function __construct(){ | |
| 16 | + $this->initSettings(); | |
| 17 | + $this->client = new Client($this->settings); | |
| 18 | + } | |
| 19 | 19 | |
| 20 | -	public function validate($xml, $xsd){ | |
| 21 | - $result = null; | |
| 20 | +    public function validate($xml, $xsd){ | |
| 21 | + $result = null; | |
| 22 | 22 | |
| 23 | -		try { | |
| 23 | +        try { | |
| 24 | 24 | |
| 25 | 25 | |
| 26 | -			//     	$response = $this->client->request('POST', '/validate', [ | |
| 27 | - // 'form_params' => [ | |
| 28 | - // 'field_name' => 'abc', | |
| 29 | - // 'other_field' => '123', | |
| 30 | - // 'nested_field' => [ | |
| 31 | - // 'nested' => 'hello' | |
| 32 | - // ] | |
| 33 | - // ] | |
| 34 | - // ]); | |
| 26 | +            //     	$response = $this->client->request('POST', '/validate', [ | |
| 27 | + // 'form_params' => [ | |
| 28 | + // 'field_name' => 'abc', | |
| 29 | + // 'other_field' => '123', | |
| 30 | + // 'nested_field' => [ | |
| 31 | + // 'nested' => 'hello' | |
| 32 | + // ] | |
| 33 | + // ] | |
| 34 | + // ]); | |
| 35 | 35 | |
| 36 | -			$response = $this->client->request('POST', '/validate', [ | |
| 37 | - 'form_params' => [ | |
| 38 | - 'parametro' => 'prova' | |
| 39 | - ] | |
| 40 | - ]); | |
| 36 | +            $response = $this->client->request('POST', '/validate', [ | |
| 37 | + 'form_params' => [ | |
| 38 | + 'parametro' => 'prova' | |
| 39 | + ] | |
| 40 | + ]); | |
| 41 | 41 | |
| 42 | - $result = $res->getBody(); | |
| 42 | + $result = $res->getBody(); | |
| 43 | 43 | |
| 44 | -		} catch (\Exception $e) { | |
| 44 | +        } catch (\Exception $e) { | |
| 45 | 45 | |
| 46 | - } | |
| 46 | + } | |
| 47 | 47 | |
| 48 | - return $result; | |
| 49 | - } | |
| 48 | + return $result; | |
| 49 | + } | |
| 50 | 50 | |
| 51 | -  	private function initSettings(){ | |
| 52 | - $this->settings['base_uri'] = $this->getBaseUri(); | |
| 53 | - $this->settings['timeout'] = $this->getTimeout(); | |
| 54 | - } | |
| 51 | +        private function initSettings(){ | |
| 52 | + $this->settings['base_uri'] = $this->getBaseUri(); | |
| 53 | + $this->settings['timeout'] = $this->getTimeout(); | |
| 54 | + } | |
| 55 | 55 | |
| 56 | -	public function setTimeout($timeout){ | |
| 57 | - $this->timeout = $timeout; | |
| 58 | - } | |
| 56 | +    public function setTimeout($timeout){ | |
| 57 | + $this->timeout = $timeout; | |
| 58 | + } | |
| 59 | 59 | |
| 60 | -	public function getTimeout(){ | |
| 61 | - return $this->timeout; | |
| 62 | - } | |
| 60 | +    public function getTimeout(){ | |
| 61 | + return $this->timeout; | |
| 62 | + } | |
| 63 | 63 | |
| 64 | -	public function getBaseUri(){ | |
| 65 | - return self::BASE_URI; | |
| 66 | - } | |
| 64 | +    public function getBaseUri(){ | |
| 65 | + return self::BASE_URI; | |
| 66 | + } | |
| 67 | 67 | |
| 68 | 68 | } |