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