Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
Bitcoin_Order_Payment_Address_Block
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 register_block
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * WordPress block for displaying the payment address of the WooCommerce order on the order confirmation page.
4 *
5 * @package    brianhenryie/bh-wp-bitcoin-gateway
6 */
7
8namespace BrianHenryIE\WP_Bitcoin_Gateway\Integrations\WooCommerce\Blocks\Order_Confirmation;
9
10use BrianHenryIE\WP_Bitcoin_Gateway\Settings_Interface;
11
12/**
13 * Register the `bh-wp-bitcoin-gateway/payment-address` block.
14 *
15 * @see assets/js/frontend/woocommerce/blocks/order-confirmation/payment-address/block.json
16 */
17class Bitcoin_Order_Payment_Address_Block {
18
19    /**
20     * Constructor
21     *
22     * @param Settings_Interface $settings Plugin settings, used to determine the plugin dir.
23     */
24    public function __construct(
25        protected Settings_Interface $settings,
26    ) {
27    }
28
29    /**
30     * @hooked init
31     */
32    public function register_block(): void {
33        register_block_type(
34            $this->settings->get_plugin_dir() . 'assets/js/frontend/woocommerce/blocks/order-confirmation/payment-address/'
35        );
36    }
37}