Skip to content

Commit

Permalink
update return types
Browse files Browse the repository at this point in the history
  • Loading branch information
vgumonis committed Dec 23, 2024
1 parent bb6e725 commit 7eb85cb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/wpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- name: Install PHP Dependencies
uses: "ramsey/composer-install@v2"
- name: Coding Standards
run: composer phpcs --ignore=build/* .
run: composer phpcs --ignore=woocommerce-plugin/woocommerce-plugin/build/* .
27 changes: 23 additions & 4 deletions includes/class-coingate-for-woocommerce-blocks-support.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,29 @@ final class Coingate_For_Woocommerce_Blocks_Support extends AbstractPaymentMetho
private $gateway;
protected $name = 'coingate'; // payment gateway id

public function initialize() {

/**
* Init
*/
public function initialize(): array {
$this->settings = get_option( "woocommerce_coingate_settings", array() );
}

public function is_active() {
/**
* payment method enabled.
*
* @return bool
*/
public function is_active(): bool {
return ! empty( $this->settings['enabled'] ) && 'yes' === $this->settings['enabled'];
}

public function get_payment_method_script_handles() {
/**
* Script to use
*
* @return array
*/
public function get_payment_method_script_handles(): array {

wp_register_script(
'wc-coingate-blocks-integration',
Expand All @@ -32,7 +46,12 @@ public function get_payment_method_script_handles() {
return array( 'wc-coingate-blocks-integration' );
}

public function get_payment_method_data() {
/**
* Payment method data
*
* @return array
*/
public function get_payment_method_data(): array {
return [
'title' => $this->get_setting( 'title' ),
'description' => $this->get_setting( 'description' ),
Expand Down
3 changes: 1 addition & 2 deletions public/class-coingate-for-woocommerce-public.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,14 @@ public function register_payment_gateway( array $methods ) {

/**
* Enable Block support
*
*/
public function woocommerce_gateway_coingate_block_support() {
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-coingate-for-woocommerce-blocks-support.php';

add_action(
'woocommerce_blocks_payment_method_type_registration',
function ( \Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) {
$payment_method_registry->register( new Coingate_For_Woocommerce_Blocks_Support );
$payment_method_registry->register( new Coingate_For_Woocommerce_Blocks_Support() );
}
);
}
Expand Down

0 comments on commit 7eb85cb

Please sign in to comment.