style(phpcs): autofix WordPress-Core violations via phpcbf
Run phpcbf --standard=WordPress-Core across includes/, prautoblogger.php, and uninstall.php. Fixed 1,362 formatting violations in 75 files: - Short array syntax: [] → array() - Line breaking for long function calls - Consistent indentation - Function call parameter alignment No logic changes; purely mechanical formatting.
This commit is contained in:
@@ -68,7 +68,7 @@ class PRAutoBlogger_Runware_Image_Support {
|
||||
|
||||
// Runware wraps errors in an `errors` array.
|
||||
if ( isset( $decoded['errors'] ) && is_array( $decoded['errors'] ) && ! empty( $decoded['errors'] ) ) {
|
||||
$first = $decoded['errors'][0] ?? [];
|
||||
$first = $decoded['errors'][0] ?? array();
|
||||
$msg = is_array( $first )
|
||||
? (string) ( $first['message'] ?? wp_json_encode( $first ) )
|
||||
: (string) $first;
|
||||
@@ -80,7 +80,7 @@ class PRAutoBlogger_Runware_Image_Support {
|
||||
);
|
||||
}
|
||||
|
||||
$data = $decoded['data'] ?? [];
|
||||
$data = $decoded['data'] ?? array();
|
||||
if ( ! is_array( $data ) || empty( $data ) ) {
|
||||
throw new \RuntimeException(
|
||||
esc_html__( 'Runware response contained no data.', 'prautoblogger' )
|
||||
@@ -115,9 +115,12 @@ class PRAutoBlogger_Runware_Image_Support {
|
||||
* @throws \RuntimeException On HTTP error or empty body.
|
||||
*/
|
||||
public function download_image_bytes( string $image_url ): string {
|
||||
$response = wp_remote_get( $image_url, [
|
||||
'timeout' => 30,
|
||||
] );
|
||||
$response = wp_remote_get(
|
||||
$image_url,
|
||||
array(
|
||||
'timeout' => 30,
|
||||
)
|
||||
);
|
||||
|
||||
if ( is_wp_error( $response ) ) {
|
||||
throw new \RuntimeException(
|
||||
|
||||
Reference in New Issue
Block a user