1 | <?php |
||
11 | class PollyConverter implements Converter |
||
12 | { |
||
13 | use Storable, Sourceable; |
||
14 | |||
15 | /** |
||
16 | * Client instance of Polly. |
||
17 | * |
||
18 | * @var \Aws\Polly\PollyClient |
||
19 | */ |
||
20 | protected $client; |
||
21 | |||
22 | /** |
||
23 | * Construct converter. |
||
24 | * |
||
25 | * @param PollyClient $client |
||
26 | */ |
||
27 | public function __construct(PollyClient $client) |
||
31 | |||
32 | |||
33 | |||
34 | /** |
||
35 | * Get the Polly Client. |
||
36 | * |
||
37 | * @return \Aws\Polly\PollyClient |
||
38 | */ |
||
39 | public function getClient(): PollyClient |
||
43 | |||
44 | /** |
||
45 | * Converts the text to speech. |
||
46 | * |
||
47 | * @param string $data |
||
48 | * @param array $options |
||
49 | * @return string |
||
50 | */ |
||
51 | public function convert(string $data, array $options = null) |
||
65 | |||
66 | /** |
||
67 | * Get the text to speech voice ID. |
||
68 | * |
||
69 | * @param array $options |
||
70 | * @return string |
||
71 | */ |
||
72 | protected function voice($options) |
||
78 | |||
79 | /** |
||
80 | * Get the audio format. |
||
81 | * |
||
82 | * @param array $options |
||
83 | * @return string |
||
84 | */ |
||
85 | protected function format($options) |
||
91 | |||
92 | /** |
||
93 | * Get the content of the result from AWS Polly. |
||
94 | * |
||
95 | * @param mixed $result |
||
96 | * @return mixed |
||
97 | */ |
||
98 | protected function getResultContent($result) |
||
102 | } |
||
103 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.