Skip to content

Commit e13c8a3

Browse files
committed
Fixed some but not all code quality issues for the logging plugin.
1 parent c35a63a commit e13c8a3

File tree

7 files changed

+554
-524
lines changed

7 files changed

+554
-524
lines changed

plugins/wpgraphql-logging/src/Admin/Settings/Fields/Tab/Basic_Configuration_Tab.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,21 +150,21 @@ public function get_fields(): array {
150150

151151

152152
$fields[ self::EVENT_LOG_SELECTION ] = new Select_Field(
153-
self::EVENT_LOG_SELECTION,
154-
$this->get_name(),
155-
__( 'Log Points', 'wpgraphql-logging' ),
156-
[
157-
Events::PRE_REQUEST => __( 'Pre Request', 'wpgraphql-logging' ),
158-
Events::BEFORE_GRAPHQL_EXECUTION => __( 'Before Query Execution', 'wpgraphql-logging' ),
159-
Events::BEFORE_RESPONSE_RETURNED => __( 'Before Response Returned', 'wpgraphql-logging' ),
160-
Events::REQUEST_DATA => __( 'Request Data', 'wpgraphql-logging' ),
161-
Events::REQUEST_RESULTS => __( 'Request Results', 'wpgraphql-logging' ),
162-
Events::RESPONSE_HEADERS_TO_SEND => __( 'Response Headers', 'wpgraphql-logging' ),
163-
],
164-
'',
165-
__( 'Select which points in the request lifecycle to log. By default, all points are logged.', 'wpgraphql-logging' ),
166-
true
167-
);
153+
self::EVENT_LOG_SELECTION,
154+
$this->get_name(),
155+
__( 'Log Points', 'wpgraphql-logging' ),
156+
[
157+
Events::PRE_REQUEST => __( 'Pre Request', 'wpgraphql-logging' ),
158+
Events::BEFORE_GRAPHQL_EXECUTION => __( 'Before Query Execution', 'wpgraphql-logging' ),
159+
Events::BEFORE_RESPONSE_RETURNED => __( 'Before Response Returned', 'wpgraphql-logging' ),
160+
Events::REQUEST_DATA => __( 'Request Data', 'wpgraphql-logging' ),
161+
Events::REQUEST_RESULTS => __( 'Request Results', 'wpgraphql-logging' ),
162+
Events::RESPONSE_HEADERS_TO_SEND => __( 'Response Headers', 'wpgraphql-logging' ),
163+
],
164+
'',
165+
__( 'Select which points in the request lifecycle to log. By default, all points are logged.', 'wpgraphql-logging' ),
166+
true
167+
);
168168

169169
return apply_filters( 'wpgraphql_logging_basic_configuration_fields', $fields );
170170
}

plugins/wpgraphql-logging/src/Events/Events.php

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -8,75 +8,75 @@
88
* List of available events that users can subscribe to with the EventManager.
99
*/
1010
final class Events {
11-
/**
12-
* WPGraphQL action: do_graphql_request.
13-
*
14-
* Before the request is processed.
15-
*
16-
* @var string
17-
*/
18-
public const PRE_REQUEST = 'do_graphql_request';
11+
/**
12+
* WPGraphQL action: do_graphql_request.
13+
*
14+
* Before the request is processed.
15+
*
16+
* @var string
17+
*/
18+
public const PRE_REQUEST = 'do_graphql_request';
1919

20-
/**
21-
* WPGraphQL action: graphql_before_execute.
22-
*
23-
* @var string
24-
*/
25-
public const BEFORE_GRAPHQL_EXECUTION = 'graphql_before_execute';
20+
/**
21+
* WPGraphQL action: graphql_before_execute.
22+
*
23+
* @var string
24+
*/
25+
public const BEFORE_GRAPHQL_EXECUTION = 'graphql_before_execute';
2626

27-
/**
28-
* WPGraphQL action: graphql_return_response
29-
*
30-
* Before the response is returned to the client.
31-
*
32-
* @var string
33-
*/
34-
public const BEFORE_RESPONSE_RETURNED = 'graphql_return_response';
27+
/**
28+
* WPGraphQL action: graphql_return_response
29+
*
30+
* Before the response is returned to the client.
31+
*
32+
* @var string
33+
*/
34+
public const BEFORE_RESPONSE_RETURNED = 'graphql_return_response';
3535

36-
/**
37-
* WPGraphQL filter: graphql_request_data.
38-
*
39-
* Allows the request data to be filtered. Ideal for capturing the
40-
* full payload before processing.
41-
*
42-
* @var string
43-
*/
44-
public const REQUEST_DATA = 'graphql_request_data';
36+
/**
37+
* WPGraphQL filter: graphql_request_data.
38+
*
39+
* Allows the request data to be filtered. Ideal for capturing the
40+
* full payload before processing.
41+
*
42+
* @var string
43+
*/
44+
public const REQUEST_DATA = 'graphql_request_data';
4545

46-
/**
47-
* WPGraphQL filter: graphql_response_headers_to_send.
48-
*
49-
* Filters the headers to send in the GraphQL response.
50-
*
51-
* @var string
52-
*/
53-
public const RESPONSE_HEADERS_TO_SEND = 'graphql_response_headers_to_send';
46+
/**
47+
* WPGraphQL filter: graphql_response_headers_to_send.
48+
*
49+
* Filters the headers to send in the GraphQL response.
50+
*
51+
* @var string
52+
*/
53+
public const RESPONSE_HEADERS_TO_SEND = 'graphql_response_headers_to_send';
5454

55-
/**
56-
* WPGraphQL filter: graphql_request_results.
57-
*
58-
* Filters the final results of the GraphQL execution.
59-
*
60-
* @var string
61-
*/
62-
public const REQUEST_RESULTS = 'graphql_request_results';
55+
/**
56+
* WPGraphQL filter: graphql_request_results.
57+
*
58+
* Filters the final results of the GraphQL execution.
59+
*
60+
* @var string
61+
*/
62+
public const REQUEST_RESULTS = 'graphql_request_results';
6363

64-
/**
65-
* WPGraphQL filter: graphql_debug_enabled.
66-
*
67-
* Determines if GraphQL Debug is enabled. Useful for toggling logging.
68-
*
69-
* @var string
70-
*/
71-
public const DEBUG_ENABLED = 'graphql_debug_enabled';
64+
/**
65+
* WPGraphQL filter: graphql_debug_enabled.
66+
*
67+
* Determines if GraphQL Debug is enabled. Useful for toggling logging.
68+
*
69+
* @var string
70+
*/
71+
public const DEBUG_ENABLED = 'graphql_debug_enabled';
7272

73-
/**
74-
* WPGraphQL filter: graphql_app_context_config.
75-
*
76-
* Filters the config for the AppContext. Useful for storing temporary
77-
* data for the duration of a request.
78-
*
79-
* @var string
80-
*/
81-
public const APP_CONTEXT_CONFIG = 'graphql_app_context_config';
82-
}
73+
/**
74+
* WPGraphQL filter: graphql_app_context_config.
75+
*
76+
* Filters the config for the AppContext. Useful for storing temporary
77+
* data for the duration of a request.
78+
*
79+
* @var string
80+
*/
81+
public const APP_CONTEXT_CONFIG = 'graphql_app_context_config';
82+
}

0 commit comments

Comments
 (0)