Skip to content

Commit

Permalink
fix more spaces around colons in return type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
reykjalin committed Mar 21, 2024
1 parent 746665d commit b580e91
Show file tree
Hide file tree
Showing 21 changed files with 63 additions and 63 deletions.
4 changes: 2 additions & 2 deletions includes/admin/class-wc-rest-payments-files-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function get_file( WP_REST_Request $request ) {
*/
add_filter(
'rest_pre_serve_request',
function ( bool $served, WP_HTTP_Response $response ) : bool {
function ( bool $served, WP_HTTP_Response $response ): bool {
echo $response->get_data(); // @codingStandardsIgnoreLine
return true;
},
Expand Down Expand Up @@ -189,7 +189,7 @@ public function get_file_content( WP_REST_Request $request ) {
*
* @return WP_Error
*/
private function file_error_response( WP_Error $error ) : WP_Error {
private function file_error_response( WP_Error $error ): WP_Error {
$error_status_code = 'resource_missing' === $error->get_error_code() ? WP_Http::NOT_FOUND : WP_Http::INTERNAL_SERVER_ERROR;
return new WP_Error(
$error->get_error_code(),
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-payment-gateway-wcpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,7 @@ public function get_payment_method_to_use_for_intent() {
* @param Payment_Information $payment_information Payment information object for transaction.
* @return array List of payment methods.
*/
public function get_payment_method_types( $payment_information ) : array {
public function get_payment_method_types( $payment_information ): array {
$requested_payment_method = sanitize_text_field( wp_unslash( $_POST['payment_method'] ?? '' ) ); // phpcs:ignore WordPress.Security.NonceVerification
$token = $payment_information->get_payment_token();

Expand Down
24 changes: 12 additions & 12 deletions includes/class-wc-payments-account.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function get_account_status_data(): array {
*
* @return string Account statement descriptor.
*/
public function get_statement_descriptor() : string {
public function get_statement_descriptor(): string {
$account = $this->get_cached_account_data();
return ! empty( $account ) && isset( $account['statement_descriptor'] ) ? $account['statement_descriptor'] : '';
}
Expand All @@ -325,7 +325,7 @@ public function get_statement_descriptor() : string {
*
* @return string Account statement descriptor.
*/
public function get_statement_descriptor_kanji() : string {
public function get_statement_descriptor_kanji(): string {
$account = $this->get_cached_account_data();
return ! empty( $account ) && isset( $account['statement_descriptor_kanji'] ) ? $account['statement_descriptor_kanji'] : '';
}
Expand All @@ -335,7 +335,7 @@ public function get_statement_descriptor_kanji() : string {
*
* @return string Account statement descriptor.
*/
public function get_statement_descriptor_kana() : string {
public function get_statement_descriptor_kana(): string {
$account = $this->get_cached_account_data();
return ! empty( $account ) && isset( $account['statement_descriptor_kana'] ) ? $account['statement_descriptor_kana'] : '';
}
Expand All @@ -345,7 +345,7 @@ public function get_statement_descriptor_kana() : string {
*
* @return string Business profile name.
*/
public function get_business_name() : string {
public function get_business_name(): string {
$account = $this->get_cached_account_data();
return isset( $account['business_profile']['name'] ) ? $account['business_profile']['name'] : '';
}
Expand All @@ -355,7 +355,7 @@ public function get_business_name() : string {
*
* @return string Business profile url.
*/
public function get_business_url() : string {
public function get_business_url(): string {
$account = $this->get_cached_account_data();
return isset( $account['business_profile']['url'] ) ? $account['business_profile']['url'] : '';
}
Expand All @@ -365,7 +365,7 @@ public function get_business_url() : string {
*
* @return array Business profile support address.
*/
public function get_business_support_address() : array {
public function get_business_support_address(): array {
$account = $this->get_cached_account_data();
return isset( $account['business_profile']['support_address'] ) ? $account['business_profile']['support_address'] : [];
}
Expand All @@ -375,7 +375,7 @@ public function get_business_support_address() : array {
*
* @return string Business profile support email.
*/
public function get_business_support_email() : string {
public function get_business_support_email(): string {
$account = $this->get_cached_account_data();
return isset( $account['business_profile']['support_email'] ) ? $account['business_profile']['support_email'] : '';
}
Expand All @@ -385,7 +385,7 @@ public function get_business_support_email() : string {
*
* @return string Business profile support phone.
*/
public function get_business_support_phone() : string {
public function get_business_support_phone(): string {
$account = $this->get_cached_account_data();
return isset( $account['business_profile']['support_phone'] ) ? $account['business_profile']['support_phone'] : '';
}
Expand All @@ -395,7 +395,7 @@ public function get_business_support_phone() : string {
*
* @return string branding logo.
*/
public function get_branding_logo() : string {
public function get_branding_logo(): string {
$account = $this->get_cached_account_data();
return isset( $account['branding']['logo'] ) ? $account['branding']['logo'] : '';
}
Expand All @@ -405,7 +405,7 @@ public function get_branding_logo() : string {
*
* @return string branding icon.
*/
public function get_branding_icon() : string {
public function get_branding_icon(): string {
$account = $this->get_cached_account_data();
return isset( $account['branding']['icon'] ) ? $account['branding']['icon'] : '';
}
Expand All @@ -415,7 +415,7 @@ public function get_branding_icon() : string {
*
* @return string branding primary color.
*/
public function get_branding_primary_color() : string {
public function get_branding_primary_color(): string {
$account = $this->get_cached_account_data();
return isset( $account['branding']['primary_color'] ) ? $account['branding']['primary_color'] : '';
}
Expand All @@ -425,7 +425,7 @@ public function get_branding_primary_color() : string {
*
* @return string branding secondary color.
*/
public function get_branding_secondary_color() : string {
public function get_branding_secondary_color(): string {
$account = $this->get_cached_account_data();
return isset( $account['branding']['secondary_color'] ) ? $account['branding']['secondary_color'] : '';
}
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-payments-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function orders_with_charge_id_from_charge_ids( array $charge_ids ): arra
);

return array_map(
function ( WC_Order $order ) : array {
function ( WC_Order $order ): array {
return [
'order' => $order,
'charge_id' => $order->get_meta( self::META_KEY_CHARGE_ID ),
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-payments-file-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class WC_Payments_File_Service {
*
* @return bool
*/
public function is_file_public( string $purpose ) : bool {
public function is_file_public( string $purpose ): bool {
return in_array( $purpose, static::FILE_PURPOSE_PUBLIC, true );
}
}
2 changes: 1 addition & 1 deletion includes/class-wc-payments-onboarding-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public static function is_test_mode_enabled(): bool {
*
* @return string The source or empty string if the source is unsupported.
*/
public static function get_source( string $referer, array $get_params ) : string {
public static function get_source( string $referer, array $get_params ): string {
$wcpay_connect_param = sanitize_text_field( wp_unslash( $get_params['wcpay-connect'] ) );
if ( 'WCADMIN_PAYMENT_TASK' === $wcpay_connect_param ) {
return self::SOURCE_WCADMIN_PAYMENT_TASK;
Expand Down
22 changes: 11 additions & 11 deletions includes/class-wc-payments-order-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ function ( array $event ) {
*
* @throws Order_Not_Found_Exception
*/
public function get_intent_id_for_order( $order ) : string {
public function get_intent_id_for_order( $order ): string {
$order = $this->get_order( $order );
return $order->get_meta( self::INTENT_ID_META_KEY, true );
}
Expand Down Expand Up @@ -510,7 +510,7 @@ public function set_intent_id_for_order( $order, $intent_id ) {
*
* @throws Order_Not_Found_Exception
*/
public function get_payment_method_id_for_order( $order ) : string {
public function get_payment_method_id_for_order( $order ): string {
$order = $this->get_order( $order );
return $order->get_meta( self::PAYMENT_METHOD_ID_META_KEY, true );
}
Expand Down Expand Up @@ -575,7 +575,7 @@ public function set_payment_transaction_id_for_order( $order, $payment_transacti
*
* @throws Order_Not_Found_Exception
*/
public function get_charge_id_for_order( $order ) : string {
public function get_charge_id_for_order( $order ): string {
$order = $this->get_order( $order );
return $order->get_meta( self::CHARGE_ID_META_KEY, true );
}
Expand Down Expand Up @@ -603,7 +603,7 @@ public function set_intention_status_for_order( $order, $intention_status ) {
*
* @throws Order_Not_Found_Exception
*/
public function get_intention_status_for_order( $order ) : string {
public function get_intention_status_for_order( $order ): string {
$order = $this->get_order( $order );
return $order->get_meta( self::INTENTION_STATUS_META_KEY, true );
}
Expand All @@ -617,7 +617,7 @@ public function get_intention_status_for_order( $order ) : string {
*
* @throws Order_Not_Found_Exception
*/
public function has_open_authorization( $order ) : bool {
public function has_open_authorization( $order ): bool {
$order = $this->get_order( $order );
return Intent_Status::REQUIRES_CAPTURE === $order->get_meta( self::INTENTION_STATUS_META_KEY, true );
}
Expand Down Expand Up @@ -646,7 +646,7 @@ public function set_customer_id_for_order( $order, $customer_id ) {
*
* @throws Order_Not_Found_Exception
*/
public function get_customer_id_for_order( $order ) : string {
public function get_customer_id_for_order( $order ): string {
$order = $this->get_order( $order );
return $order->get_meta( self::CUSTOMER_ID_META_KEY, true );
}
Expand Down Expand Up @@ -674,7 +674,7 @@ public function set_wcpay_intent_currency_for_order( $order, $wcpay_intent_curre
*
* @throws Order_Not_Found_Exception
*/
public function get_wcpay_intent_currency_for_order( $order ) : string {
public function get_wcpay_intent_currency_for_order( $order ): string {
$order = $this->get_order( $order );
return $order->get_meta( self::WCPAY_INTENT_CURRENCY_META_KEY, true );
}
Expand Down Expand Up @@ -716,7 +716,7 @@ public function set_wcpay_refund_transaction_id_for_order( WC_Order_Refund $orde
*
* @throws Order_Not_Found_Exception
*/
public function get_wcpay_refund_id_for_order( $order ) : string {
public function get_wcpay_refund_id_for_order( $order ): string {
$order = $this->get_order( $order );
return $order->get_meta( self::WCPAY_REFUND_ID_META_KEY, true );
}
Expand Down Expand Up @@ -744,7 +744,7 @@ public function set_wcpay_refund_status_for_order( $order, $wcpay_refund_status
*
* @throws Order_Not_Found_Exception
*/
public function get_wcpay_refund_status_for_order( $order ) : string {
public function get_wcpay_refund_status_for_order( $order ): string {
$order = $this->get_order( $order );
return $order->get_meta( self::WCPAY_REFUND_STATUS_META_KEY, true );
}
Expand Down Expand Up @@ -772,7 +772,7 @@ public function set_fraud_outcome_status_for_order( $order, $fraud_outcome_statu
*
* @throws Order_Not_Found_Exception
*/
public function get_fraud_outcome_status_for_order( $order ) : string {
public function get_fraud_outcome_status_for_order( $order ): string {
$order = $this->get_order( $order );
return $order->get_meta( self::WCPAY_FRAUD_OUTCOME_STATUS_META_KEY, true );
}
Expand Down Expand Up @@ -800,7 +800,7 @@ public function set_fraud_meta_box_type_for_order( $order, $fraud_meta_box_type
*
* @throws Order_Not_Found_Exception
*/
public function get_fraud_meta_box_type_for_order( $order ) : string {
public function get_fraud_meta_box_type_for_order( $order ): string {
$order = $this->get_order( $order );
return $order->get_meta( self::WCPAY_FRAUD_META_BOX_TYPE_META_KEY, true );
}
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-payments-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ public static function get_filtered_error_message( Exception $e ) {
*
* @return int
*/
public static function get_filtered_error_status_code( Exception $e ) : int {
public static function get_filtered_error_status_code( Exception $e ): int {
if ( $e instanceof API_Exception ) {
return $e->get_http_code() ?? 400;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/compat/blocks/class-blocks-data-extractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function get_data() {
*
* @return array
*/
public function get_checkout_schema_namespaces() : array {
public function get_checkout_schema_namespaces(): array {
$namespaces = [];

if (
Expand Down
8 changes: 4 additions & 4 deletions includes/core/class-mode.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private function maybe_init() {
* @throws Exception In case the class has not been initialized yet.
* @return bool
*/
public function is_live() : bool {
public function is_live(): bool {
$this->maybe_init();
return ! $this->test_mode && ! $this->dev_mode;
}
Expand All @@ -105,7 +105,7 @@ public function is_live() : bool {
* @throws Exception In case the class has not been initialized yet.
* @return bool
*/
public function is_test() : bool {
public function is_test(): bool {
$this->maybe_init();

return $this->test_mode;
Expand All @@ -117,7 +117,7 @@ public function is_test() : bool {
* @throws Exception In case the class has not been initialized yet.
* @return bool
*/
public function is_dev() : bool {
public function is_dev(): bool {
$this->maybe_init();
return $this->dev_mode;
}
Expand Down Expand Up @@ -157,7 +157,7 @@ public function dev() {
*
* @return bool Whether `WCPAY_DEV_MODE` is defined and true.
*/
protected function is_wcpay_dev_mode_defined() : bool {
protected function is_wcpay_dev_mode_defined(): bool {
return(
defined( 'WCPAY_DEV_MODE' )
&& WCPAY_DEV_MODE
Expand Down
2 changes: 1 addition & 1 deletion includes/core/server/class-response.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct( array $data ) {
* @param mixed $offset The key to check.
* @return bool
*/
public function offsetExists( $offset ) : bool {
public function offsetExists( $offset ): bool {
return isset( $this->data[ $offset ] );
}

Expand Down
2 changes: 1 addition & 1 deletion includes/multi-currency/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function get_symbol(): string {
*
* @return string Currency position (left/right).
*/
public function get_symbol_position() : string {
public function get_symbol_position(): string {
$localization_service = new WC_Payments_Localization_Service();
return $localization_service->get_currency_format( $this->code )['currency_pos'];
}
Expand Down
4 changes: 2 additions & 2 deletions includes/notes/class-wc-payments-remote-note-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct( WC_Data_Store $note_data_store ) {
*
* @throws Rest_Request_Exception If note data is invalid.
*/
public function put_note( array $note_data ) : bool {
public function put_note( array $note_data ): bool {
$note = $this->create_note( $note_data );

if ( ! $this->can_note_be_added( $note->get_name() ) ) {
Expand Down Expand Up @@ -127,7 +127,7 @@ public function delete_notes() {
*
* @return boolean True if the note can be added.
*/
private function can_note_be_added( string $note_name ) : bool {
private function can_note_be_added( string $note_name ): bool {
$note_ids = $this->note_data_store->get_notes_with_name( $note_name );
return empty( $note_ids );
}
Expand Down
Loading

0 comments on commit b580e91

Please sign in to comment.