Skip to content

Commit a2f6d10

Browse files
Sergii KryvonosSergii Kryvonos
authored andcommitted
Fix coding standards for WP_D1_Connection
1 parent a47c6b6 commit a2f6d10

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

‎packages/mysql-on-sqlite/src/sqlite/class-wp-d1-connection.php‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?php declare(strict_types = 1);
22

3+
/*
4+
* phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5+
* phpcs:disable Generic.Files.OneObjectStructurePerFile.MultipleFound
6+
*/
7+
38
/**
49
* Cloudflare D1 connection.
510
*
@@ -158,18 +163,27 @@ public function set_query_logger( $logger ): void {
158163
*/
159164
public function execute_remote( string $sql, array $params = array() ): array {
160165
$url = rtrim( $this->api_base, '/' ) . '/accounts/' . rawurlencode( $this->account_id ) . '/d1/database/' . rawurlencode( $this->database_id ) . '/query';
161-
$body = json_encode( array( 'sql' => $sql, 'params' => array_values( $params ) ) );
166+
$body = json_encode(
167+
array(
168+
'sql' => $sql,
169+
'params' => array_values( $params ),
170+
)
171+
);
162172

163173
$raw = null;
164174
$code = 0;
165175
if ( function_exists( 'curl_init' ) ) {
166176
$ch = curl_init( $url );
167177
curl_setopt( $ch, CURLOPT_POST, true );
168178
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
169-
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
170-
'Authorization: Bearer ' . $this->api_token,
171-
'Content-Type: application/json',
172-
) );
179+
curl_setopt(
180+
$ch,
181+
CURLOPT_HTTPHEADER,
182+
array(
183+
'Authorization: Bearer ' . $this->api_token,
184+
'Content-Type: application/json',
185+
)
186+
);
173187
curl_setopt( $ch, CURLOPT_POSTFIELDS, $body );
174188
curl_setopt( $ch, CURLOPT_TIMEOUT, 30 );
175189
$raw = curl_exec( $ch );

0 commit comments

Comments
 (0)