Skip to content

Commit

Permalink
formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shekharnwagh committed Jan 3, 2025
1 parent 0b336f6 commit 307bef0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
14 changes: 11 additions & 3 deletions inc/Integrations/Airtable/AirtableIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@ public static function init(): void {
}

public static function register_blocks(): void {
$data_source_configs = DataSourceCrud::get_configs_by_service( REMOTE_DATA_BLOCKS_AIRTABLE_SERVICE );
$data_source_configs = DataSourceCrud::get_configs_by_service(
REMOTE_DATA_BLOCKS_AIRTABLE_SERVICE
);

foreach ( $data_source_configs as $config ) {
$data_source = AirtableDataSource::from_array( $config );
self::register_block_for_airtable_data_source( $data_source );
}
}

public static function register_block_for_airtable_data_source( AirtableDataSource $data_source, array $block_overrides = [] ): void {
public static function register_block_for_airtable_data_source(
AirtableDataSource $data_source,
array $block_overrides = []
): void {
register_remote_data_block(
array_merge(
[
Expand All @@ -38,7 +43,10 @@ public static function register_block_for_airtable_data_source( AirtableDataSour
);
}

public static function register_loop_block_for_airtable_data_source( AirtableDataSource $data_source, array $block_overrides = [] ): void {
public static function register_loop_block_for_airtable_data_source(
AirtableDataSource $data_source,
array $block_overrides = []
): void {
register_remote_data_block(
array_merge(
[
Expand Down
7 changes: 4 additions & 3 deletions inc/Integrations/Google/Sheets/GoogleSheetsDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ protected static function get_service_config_schema(): array {
protected static function map_service_config( array $service_config ): array {
return [
'display_name' => $service_config['display_name'],
'endpoint' => sprintf( 'https://sheets.googleapis.com/v4/spreadsheets/%s', $service_config['spreadsheet']['id'] ),
'endpoint' => sprintf(
'https://sheets.googleapis.com/v4/spreadsheets/%s',
$service_config['spreadsheet']['id']
),
'request_headers' => function () use ( $service_config ): array {
$access_token = GoogleAuth::generate_token_from_service_account_key(
$service_config['credentials'],
Expand Down Expand Up @@ -88,7 +91,6 @@ public function ___temp_get_query(): HttpQuery {
],
];


foreach ( $service_config['sheets'][0]['output_query_mappings'] as $mapping ) {
$mapping_key = $mapping['key'];
$output_schema['type'][ $mapping_key ] = [
Expand Down Expand Up @@ -126,7 +128,6 @@ public function ___temp_get_list_query(): HttpQuery {
],
];


foreach ( $service_config['sheets'][0]['output_query_mappings'] as $mapping ) {
$mapping_key = $mapping['key'];
$output_schema['type'][ $mapping_key ] = [
Expand Down
15 changes: 12 additions & 3 deletions inc/Integrations/Google/Sheets/GoogleSheetsIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ public static function init(): void {
}

public static function register_blocks(): void {
$data_source_configs = DataSourceCrud::get_configs_by_service( REMOTE_DATA_BLOCKS_GOOGLE_SHEETS_SERVICE );
$data_source_configs = DataSourceCrud::get_configs_by_service(
REMOTE_DATA_BLOCKS_GOOGLE_SHEETS_SERVICE
);

foreach ( $data_source_configs as $config ) {
$data_source = GoogleSheetsDataSource::from_array( $config );
self::register_block_for_google_sheets_data_source( $data_source );
self::register_loop_block_for_google_sheets_data_source( $data_source );
}
}
public static function register_block_for_google_sheets_data_source( GoogleSheetsDataSource $data_source, array $block_overrides = [] ): void {

public static function register_block_for_google_sheets_data_source(
GoogleSheetsDataSource $data_source,
array $block_overrides = []
): void {
register_remote_data_block(
array_merge(
[
Expand All @@ -38,7 +44,10 @@ public static function register_block_for_google_sheets_data_source( GoogleSheet
);
}

public static function register_loop_block_for_google_sheets_data_source( GoogleSheetsDataSource $data_source, array $block_overrides = [] ): void {
public static function register_loop_block_for_google_sheets_data_source(
GoogleSheetsDataSource $data_source,
array $block_overrides = []
): void {
register_remote_data_block(
array_merge(
[
Expand Down

0 comments on commit 307bef0

Please sign in to comment.