Use assert instead of long comments

This commit is contained in:
Narek Zakarian 2022-08-17 19:06:20 +04:00
parent 9b63ab0b91
commit 9ea71be37b
2 changed files with 9 additions and 26 deletions

View file

@ -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 ) {