Skip to content

Commit 2a5498e

Browse files
committed
remove bool typing for WordPress filters
1 parent 04352ad commit 2a5498e

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

includes/API/Product_Variations_Controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public function wcpos_variation_response( WP_REST_Response $response, WC_Data $v
210210
* @param WP_REST_Request $request Request object.
211211
* @param bool $creating True when creating object, false when updating.
212212
*/
213-
public function wcpos_insert_product_variation_object( WC_Data $object, WP_REST_Request $request, bool $creating ): void {
213+
public function wcpos_insert_product_variation_object( WC_Data $object, WP_REST_Request $request, $creating ): void {
214214
$barcode_field = $this->wcpos_get_barcode_field();
215215
if ( $request->has_param( 'barcode' ) ) {
216216
$barcode = $request->get_param( 'barcode' );

includes/API/Products_Controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public function wcpos_product_response( WP_REST_Response $response, WC_Product $
231231
* @param WP_REST_Request $request Request object.
232232
* @param bool $creating True when creating object, false when updating.
233233
*/
234-
public function wcpos_insert_product_object( WC_Data $object, WP_REST_Request $request, bool $creating ): void {
234+
public function wcpos_insert_product_object( WC_Data $object, WP_REST_Request $request, $creating ): void {
235235
$barcode_field = $this->wcpos_get_barcode_field();
236236
if ( $request->has_param( 'barcode' ) ) {
237237
$barcode = $request->get_param( 'barcode' );

includes/Admin/Orders/Single_Order.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ public function add_available_gateways() {
5454
*
5555
* @return bool
5656
*/
57-
public function wc_order_is_editable( bool $is_editable, WC_Abstract_Order $order ): bool {
57+
public function wc_order_is_editable( $is_editable, WC_Abstract_Order $order ) {
5858
if ( 'pos-open' == $order->get_status() ) {
59-
$is_editable = true;
59+
return true;
6060
}
6161

6262
return $is_editable;

includes/Init.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ public function init_rest_api(): void {
123123
* to work, or any other custom query variables you want to be publicly available.
124124
*
125125
* @param string[] $query_vars The array of allowed query variable names.
126+
*
127+
* @return string[] The array of allowed query variable names.
126128
*/
127129
public function query_vars( array $query_vars ): array {
128130
$query_vars[] = SHORT_NAME;
@@ -143,7 +145,7 @@ public function query_vars( array $query_vars ): array {
143145
*
144146
* @return bool $served
145147
*/
146-
public function rest_pre_serve_request( bool $served, WP_HTTP_Response $result, WP_REST_Request $request, WP_REST_Server $server ): bool {
148+
public function rest_pre_serve_request( $served, WP_HTTP_Response $result, WP_REST_Request $request, WP_REST_Server $server ) {
147149
if ( 'OPTIONS' == $request->get_method() ) {
148150
$allow_headers = array(
149151
'Authorization', // For user-agent authentication with a server.
@@ -168,6 +170,8 @@ public function rest_pre_serve_request( bool $served, WP_HTTP_Response $result,
168170
* Fires once the requested HTTP headers for caching, content type, etc. have been sent.
169171
*
170172
* FIXME: Why is Link header not exposed sometimes on my development machine?
173+
*
174+
* @return void
171175
*/
172176
public function send_headers(): void {
173177
// some server convert HEAD to GET method, so use this query param instead

tests/includes/API/Test_Product_Categories_Controller.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ public function test_unique_product_category_uuid() {
207207
$uuids = wp_list_pluck( $data, 'uuid' );
208208

209209
$this->assertEquals( 3, \count( $uuids ) );
210-
$this->assertContains( $uuid, $uuids );
211210
$this->assertEquals( 3, \count( array_unique( $uuids ) ) );
212211
}
213212
}

0 commit comments

Comments
 (0)