1 | <?php |
||
12 | class Payload |
||
13 | { |
||
14 | |||
15 | const SERVICE_TYPE_LIST = 'ListVoices'; |
||
16 | const SERVICE_TYPE_SPEECH = 'CreateSpeech'; |
||
17 | const DEFAULT_EN_VOICE = 'Salli'; |
||
18 | const DEFAULT_RU_VOICE = 'Tatyana'; |
||
19 | |||
20 | /** |
||
21 | * @var Options |
||
22 | */ |
||
23 | protected $options; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $payload; |
||
29 | |||
30 | protected $queryText; |
||
31 | protected $serviceUrl = "https://tts.eu-west-1.ivonacloud.com"; |
||
32 | protected $outputFormatCodec = 'MP3'; |
||
33 | protected $outputSampleRate = '22050'; |
||
34 | protected $parametersRate = 'slow'; |
||
35 | |||
36 | /** |
||
37 | * Get service headers |
||
38 | * @return array |
||
39 | */ |
||
40 | 1 | public function getHeaders() |
|
55 | |||
56 | /** |
||
57 | * Create json object with post parameters |
||
58 | * @return $this |
||
59 | */ |
||
60 | public function createPayload() |
||
81 | |||
82 | /** |
||
83 | * Set payload |
||
84 | * @param $payload |
||
85 | * @return $this |
||
86 | */ |
||
87 | public function setPayload($payload) |
||
92 | |||
93 | /** |
||
94 | * Get post data for service |
||
95 | * @return array |
||
96 | */ |
||
97 | 1 | public function getPayload() |
|
101 | |||
102 | /** |
||
103 | * Get url for service with service type |
||
104 | * @return string |
||
105 | */ |
||
106 | 1 | public function getServiceUrl() |
|
110 | |||
111 | /** |
||
112 | * @return array |
||
113 | */ |
||
114 | public function isRussian() |
||
121 | |||
122 | /** |
||
123 | * Check available name for service |
||
124 | * @param string $serviceType |
||
125 | * @return string |
||
126 | * @throw |
||
127 | */ |
||
128 | 2 | protected function checkServiceType($serviceType) |
|
137 | |||
138 | /** |
||
139 | * @return Options |
||
140 | */ |
||
141 | 2 | public function getOptions() |
|
145 | |||
146 | /** |
||
147 | * @param Options $options |
||
148 | * @return $this |
||
149 | */ |
||
150 | 2 | public function setOptions($options) |
|
155 | |||
156 | /** |
||
157 | * @return string |
||
158 | */ |
||
159 | 1 | public function getQueryText() |
|
166 | |||
167 | /** |
||
168 | * @param string $queryText |
||
169 | */ |
||
170 | 1 | public function setQueryText($queryText) |
|
174 | } |
||
175 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: