Skip to content

Commit 0324cdd

Browse files
committed
PHPCS fixes.
1 parent ac590bf commit 0324cdd

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

includes/Classifai/Providers/AWS/AmazonPolly.php

+14-12
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function render_provider_fields() {
6767
]
6868
),
6969
esc_url( 'https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey' )
70-
)
70+
),
7171
]
7272
);
7373

@@ -138,11 +138,11 @@ public function render_provider_fields() {
138138
esc_url( 'https://docs.aws.amazon.com/polly/latest/dg/long-form-voice-overview.html' ),
139139
esc_url( 'https://docs.aws.amazon.com/polly/latest/dg/NTTS-main.html' ),
140140
esc_url( 'https://aws.amazon.com/polly/pricing/' )
141-
)
141+
),
142142
]
143143
);
144144

145-
$voices_options = $this->get_voices_select_options( $settings['voice_engine'] ?? '' );
145+
$voices_options = $this->get_voices_select_options( $settings['voice_engine'] ?? '' );
146146
if ( ! empty( $voices_options ) ) {
147147
add_settings_field(
148148
'voice',
@@ -213,7 +213,7 @@ public function sanitize_settings( array $new_settings ): array {
213213
$new_settings[ static::ID ]['access_key_id'] = $new_access_key_id;
214214
$new_settings[ static::ID ]['secret_access_key'] = $new_secret_access_key;
215215
$new_settings[ static::ID ]['aws_region'] = $new_aws_region;
216-
$new_settings[ static::ID ]['voices'] = $this->connect_to_service(
216+
$new_settings[ static::ID ]['voices'] = $this->connect_to_service(
217217
array(
218218
'access_key_id' => $new_access_key_id,
219219
'secret_access_key' => $new_secret_access_key,
@@ -271,7 +271,7 @@ public function connect_to_service( array $args = array() ): array {
271271
try {
272272
$polly_client = $this->get_polly_client( $args );
273273
$polly_voices = $polly_client->describeVoices();
274-
return $polly_voices->get('Voices');
274+
return $polly_voices->get( 'Voices' );
275275
} catch ( \Exception $e ) {
276276
add_settings_error(
277277
$this->feature_instance->get_option_name(),
@@ -286,9 +286,10 @@ public function connect_to_service( array $args = array() ): array {
286286
/**
287287
* Returns HTML select dropdown options for voices.
288288
*
289+
* @param string $engine Engine type.
289290
* @return array
290291
*/
291-
public function get_voices_select_options( string $engine = "" ): array {
292+
public function get_voices_select_options( string $engine = '' ): array {
292293
$settings = $this->feature_instance->get_settings( static::ID );
293294
$voices = $settings['voices'];
294295
$options = array();
@@ -364,7 +365,7 @@ public function synthesize_speech( int $post_id ) {
364365
$voice = $settings[ static::ID ]['voice'] ?? '';
365366

366367
try {
367-
$polly_client = $this->get_polly_client();
368+
$polly_client = $this->get_polly_client();
368369

369370
/**
370371
* Filter Synthesize speech args.
@@ -392,6 +393,7 @@ public function synthesize_speech( int $post_id ) {
392393
$this,
393394
$this->feature_instance
394395
);
396+
395397
$result = $polly_client->synthesizeSpeech( $synthesize_data );
396398

397399
update_post_meta( $post_id, self::AUDIO_HASH_KEY, md5( $post_content ) );
@@ -485,17 +487,17 @@ public function get_polly_client( array $aws_config = array() ) {
485487
}
486488

487489
// Set the AWS SDK configuration.
488-
$aws_sdk_config = [
489-
'region' => $default['aws_region'] ?? 'us-east-1',
490-
'version' => 'latest',
491-
'ua_append' => ['request-source/classifai'],
490+
$aws_sdk_config = [
491+
'region' => $default['aws_region'] ?? 'us-east-1',
492+
'version' => 'latest',
493+
'ua_append' => [ 'request-source/classifai' ],
492494
'credentials' => [
493495
'key' => $default['access_key_id'],
494496
'secret' => $default['secret_access_key'],
495497
],
496498
];
497499

498-
$sdk = new \Aws\Sdk($aws_sdk_config);
500+
$sdk = new \Aws\Sdk( $aws_sdk_config );
499501
return $sdk->createPolly();
500502
}
501503

0 commit comments

Comments
 (0)