mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Use assert instead of long comments
This commit is contained in:
parent
9b63ab0b91
commit
9ea71be37b
2 changed files with 9 additions and 26 deletions
|
@ -2425,8 +2425,9 @@ return array(
|
|||
},
|
||||
'order-tracking.is-tracking-available' => static function ( ContainerInterface $container ): bool {
|
||||
try {
|
||||
/* @var Bearer $bearer The bearer. */
|
||||
$bearer = $container->get( 'api.bearer' );
|
||||
assert( $bearer instanceof Bearer );
|
||||
|
||||
$token = $bearer->bearer();
|
||||
return $token->is_tracking_available();
|
||||
} catch ( RuntimeException $exception ) {
|
||||
|
@ -2434,12 +2435,9 @@ return array(
|
|||
}
|
||||
},
|
||||
'wcgateway.settings.should-disable-tracking-checkbox' => static function ( ContainerInterface $container ): bool {
|
||||
/**
|
||||
* The PUI helper.
|
||||
*
|
||||
* @var PayUponInvoiceHelper $pui_helper
|
||||
*/
|
||||
$pui_helper = $container->get( 'wcgateway.pay-upon-invoice-helper' );
|
||||
assert( $pui_helper instanceof PayUponInvoiceHelper );
|
||||
|
||||
$is_tracking_available = $container->get( 'order-tracking.is-tracking-available' );
|
||||
|
||||
if ( ! $is_tracking_available ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue