Skip to content

Commit d6f7eed

Browse files
committed
lint: run phpcbf
1 parent ccfb39d commit d6f7eed

File tree

4 files changed

+46
-46
lines changed

4 files changed

+46
-46
lines changed

plugins/wpgraphql-logging/src/Admin/View/List/List_Table.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function process_bulk_action(): void {
128128

129129
// Nonce action WordPress uses for bulk actions is 'bulk-' . $this->_args['plural']
130130
$nonce_action = 'bulk-' . $this->_args['plural'];
131-
$nonce_value = $_REQUEST['_wpnonce'] ?? '';
131+
$nonce_value = $_REQUEST['_wpnonce'] ?? '';
132132

133133
// Ensure nonce is a string for wp_verify_nonce
134134
$nonce = is_string( $nonce_value ) ? $nonce_value : '';
@@ -162,7 +162,7 @@ public function process_bulk_action(): void {
162162
if ( $deleted_count > 0 ) {
163163
// Preserve filters during redirect
164164
$preserved_filters = [];
165-
$filter_keys = [ 'level_filter', 'start_date', 'end_date' ];
165+
$filter_keys = [ 'level_filter', 'start_date', 'end_date' ];
166166

167167
foreach ( $filter_keys as $key ) {
168168
$value = $_REQUEST[ $key ] ?? null;
@@ -488,10 +488,12 @@ protected function render_custom_filters(): void {
488488
__DIR__ . '/../Templates/wpgraphql-logger-filters.php'
489489
);
490490

491-
if ( file_exists( $template ) ) {
492-
echo '<div class="alignleft actions">';
493-
require $template; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable
494-
echo '</div>';
491+
if ( ! file_exists( $template ) ) {
492+
return;
495493
}
494+
495+
echo '<div class="alignleft actions">';
496+
require $template; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable
497+
echo '</div>';
496498
}
497499
}
Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
if ( ! defined( 'ABSPATH' ) ) {
5-
exit;
6+
exit;
67
}
78

89
// Current filter values.
@@ -14,28 +15,28 @@
1415
?>
1516

1617
<div class="alignleft actions" style="display: inline-flex; align-items: center; gap: 8px; margin-right: 10px;">
17-
<input type="text"
18-
name="start_date"
19-
class="wpgraphql-logging-datepicker"
20-
placeholder="Start Date"
21-
value="<?php echo esc_attr( $current_start_date ); ?>"
22-
style="width: 120px;" />
23-
24-
<input type="text"
25-
name="end_date"
26-
class="wpgraphql-logging-datepicker"
27-
placeholder="End Date"
28-
value="<?php echo esc_attr( $current_end_date ); ?>"
29-
style="width: 120px;" />
18+
<input type="text"
19+
name="start_date"
20+
class="wpgraphql-logging-datepicker"
21+
placeholder="Start Date"
22+
value="<?php echo esc_attr( $current_start_date ); ?>"
23+
style="width: 120px;" />
24+
25+
<input type="text"
26+
name="end_date"
27+
class="wpgraphql-logging-datepicker"
28+
placeholder="End Date"
29+
value="<?php echo esc_attr( $current_end_date ); ?>"
30+
style="width: 120px;" />
3031

31-
<select name="level_filter" style="width: 120px;">
32-
<option value="">All Levels</option>
33-
<?php foreach ( $log_levels as $level ) : ?>
34-
<option value="<?php echo esc_attr( $level ); ?>" <?php selected( $current_level, $level ); ?>>
35-
<?php echo esc_html( ucfirst( $level ) ); ?>
36-
</option>
37-
<?php endforeach; ?>
38-
</select>
32+
<select name="level_filter" style="width: 120px;">
33+
<option value="">All Levels</option>
34+
<?php foreach ( $log_levels as $level ) : ?>
35+
<option value="<?php echo esc_attr( $level ); ?>" <?php selected( $current_level, $level ); ?>>
36+
<?php echo esc_html( ucfirst( $level ) ); ?>
37+
</option>
38+
<?php endforeach; ?>
39+
</select>
3940

40-
<?php submit_button( __( 'Filter', 'wpgraphql-logging' ), 'secondary', '', false, [ 'style' => 'margin: 0;' ] ); ?>
41-
</div>
41+
<?php submit_button( __( 'Filter', 'wpgraphql-logging' ), 'secondary', '', false, [ 'style' => 'margin: 0;' ] ); ?>
42+
</div>

plugins/wpgraphql-logging/src/Logger/Database/LogsRepository.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ public function delete(int $id): bool {
111111

112112
/**
113113
* Delete all log entries.
114-
*
115-
* @return void
116114
*/
117115
public function delete_all(): void {
118116
global $wpdb;

plugins/wpgraphql-logging/src/Logger/LoggingHelper.php

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ protected function is_logging_enabled( array $config, ?string $query_string = nu
5050
}
5151

5252
// Check if the query is an introspection query and skip logging if it is.
53-
if ( $is_enabled && $this->is_introspection_query( $query_string ) ) {
54-
$is_enabled = false;
55-
}
53+
if ( $is_enabled && $this->is_introspection_query( $query_string ) ) {
54+
$is_enabled = false;
55+
}
5656

5757
/**
5858
* Filter the final decision on whether to log a request.
@@ -64,16 +64,15 @@ protected function is_logging_enabled( array $config, ?string $query_string = nu
6464
}
6565

6666
/**
67-
* Checks if a query is an introspection query.
68-
*
69-
* @param string|null $query_string The GraphQL query string.
70-
* @return bool
71-
*/
72-
protected function is_introspection_query( ?string $query_string ): bool {
73-
if ( null === $query_string ) {
74-
return false;
75-
}
67+
* Checks if a query is an introspection query.
68+
*
69+
* @param string|null $query_string The GraphQL query string.
70+
*/
71+
protected function is_introspection_query( ?string $query_string ): bool {
72+
if ( null === $query_string ) {
73+
return false;
74+
}
7675

77-
return strpos( $query_string, '__schema' ) !== false;
78-
}
76+
return strpos( $query_string, '__schema' ) !== false;
77+
}
7978
}

0 commit comments

Comments
 (0)