@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Get service headers |
| 36 | - * @return array |
|
| 36 | + * @return string[] |
|
| 37 | 37 | */ |
| 38 | 38 | public function getHeaders() |
| 39 | 39 | { |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | 75 | * Set payload |
| 76 | - * @param $payload |
|
| 76 | + * @param string $payload |
|
| 77 | 77 | * @return $this |
| 78 | 78 | */ |
| 79 | 79 | public function setPayload($payload) |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | 86 | * Get post data for service |
| 87 | - * @return array |
|
| 87 | + * @return string |
|
| 88 | 88 | */ |
| 89 | 89 | public function getPayload() |
| 90 | 90 | { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $headers = [ |
| 39 | 39 | 'Content-Type: application/json', |
| 40 | 40 | 'Host: tts.eu-west-1.ivonacloud.com', |
| 41 | - 'User-Agent: ' . $this->getOptions()->getUserAgent() |
|
| 41 | + 'User-Agent: '.$this->getOptions()->getUserAgent() |
|
| 42 | 42 | ]; |
| 43 | 43 | |
| 44 | 44 | return array_merge( |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function createPayload() |
| 55 | 55 | { |
| 56 | - $payloadArray = (object)array(); |
|
| 56 | + $payloadArray = (object) array(); |
|
| 57 | 57 | $payloadArray->Input['Data'] = $this->getQueryText(); |
| 58 | 58 | $payloadArray->Input['Type'] = 'text/plain'; |
| 59 | 59 | |
| 60 | 60 | $payloadArray->OutputFormat['Codec'] = $this->getOptions()->getOutputFormatCodec(); |
| 61 | - $payloadArray->OutputFormat['SampleRate'] = (int)$this->getOptions()->getOutputSampleRate(); |
|
| 61 | + $payloadArray->OutputFormat['SampleRate'] = (int) $this->getOptions()->getOutputSampleRate(); |
|
| 62 | 62 | $payloadArray->Voice['Language'] = $this->getOptions()->getLanguage(); |
| 63 | 63 | $payloadArray->Voice['Name'] = $this->getOptions()->getVoice(); |
| 64 | 64 | $payloadArray->Parameters['Rate'] = $this->getOptions()->getParametersRate(); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | public function getServiceUrl() |
| 95 | 95 | { |
| 96 | - return $this->serviceUrl . '/' . self::SERVICE_TYPE_SPEECH; |
|
| 96 | + return $this->serviceUrl.'/'.self::SERVICE_TYPE_SPEECH; |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $reflection = new \ReflectionObject($this); |
| 108 | 108 | $constants = $reflection->getConstants(); |
| 109 | 109 | if (!in_array($serviceType, $constants)) { |
| 110 | - throw new RuntimeException('Service type does not supports: ' . $serviceType); |
|
| 110 | + throw new RuntimeException('Service type does not supports: '.$serviceType); |
|
| 111 | 111 | } |
| 112 | 112 | return $serviceType; |
| 113 | 113 | } |