Skip to content

Commit

Permalink
remove bool typing for WordPress filters
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbot committed Mar 7, 2024
1 parent 04352ad commit 2a5498e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion includes/API/Product_Variations_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function wcpos_variation_response( WP_REST_Response $response, WC_Data $v
* @param WP_REST_Request $request Request object.
* @param bool $creating True when creating object, false when updating.
*/
public function wcpos_insert_product_variation_object( WC_Data $object, WP_REST_Request $request, bool $creating ): void {
public function wcpos_insert_product_variation_object( WC_Data $object, WP_REST_Request $request, $creating ): void {
$barcode_field = $this->wcpos_get_barcode_field();
if ( $request->has_param( 'barcode' ) ) {
$barcode = $request->get_param( 'barcode' );
Expand Down
2 changes: 1 addition & 1 deletion includes/API/Products_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public function wcpos_product_response( WP_REST_Response $response, WC_Product $
* @param WP_REST_Request $request Request object.
* @param bool $creating True when creating object, false when updating.
*/
public function wcpos_insert_product_object( WC_Data $object, WP_REST_Request $request, bool $creating ): void {
public function wcpos_insert_product_object( WC_Data $object, WP_REST_Request $request, $creating ): void {
$barcode_field = $this->wcpos_get_barcode_field();
if ( $request->has_param( 'barcode' ) ) {
$barcode = $request->get_param( 'barcode' );
Expand Down
4 changes: 2 additions & 2 deletions includes/Admin/Orders/Single_Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public function add_available_gateways() {
*
* @return bool
*/
public function wc_order_is_editable( bool $is_editable, WC_Abstract_Order $order ): bool {
public function wc_order_is_editable( $is_editable, WC_Abstract_Order $order ) {
if ( 'pos-open' == $order->get_status() ) {
$is_editable = true;
return true;
}

return $is_editable;
Expand Down
6 changes: 5 additions & 1 deletion includes/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ public function init_rest_api(): void {
* to work, or any other custom query variables you want to be publicly available.
*
* @param string[] $query_vars The array of allowed query variable names.
*
* @return string[] The array of allowed query variable names.
*/
public function query_vars( array $query_vars ): array {
$query_vars[] = SHORT_NAME;
Expand All @@ -143,7 +145,7 @@ public function query_vars( array $query_vars ): array {
*
* @return bool $served
*/
public function rest_pre_serve_request( bool $served, WP_HTTP_Response $result, WP_REST_Request $request, WP_REST_Server $server ): bool {
public function rest_pre_serve_request( $served, WP_HTTP_Response $result, WP_REST_Request $request, WP_REST_Server $server ) {
if ( 'OPTIONS' == $request->get_method() ) {
$allow_headers = array(
'Authorization', // For user-agent authentication with a server.
Expand All @@ -168,6 +170,8 @@ public function rest_pre_serve_request( bool $served, WP_HTTP_Response $result,
* Fires once the requested HTTP headers for caching, content type, etc. have been sent.
*
* FIXME: Why is Link header not exposed sometimes on my development machine?
*
* @return void
*/
public function send_headers(): void {
// some server convert HEAD to GET method, so use this query param instead
Expand Down
1 change: 0 additions & 1 deletion tests/includes/API/Test_Product_Categories_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ public function test_unique_product_category_uuid() {
$uuids = wp_list_pluck( $data, 'uuid' );

$this->assertEquals( 3, \count( $uuids ) );
$this->assertContains( $uuid, $uuids );
$this->assertEquals( 3, \count( array_unique( $uuids ) ) );
}
}

0 comments on commit 2a5498e

Please sign in to comment.