$reasons The reasons collected so far. * @param int $customerId The customer id about to be deleted. * @return array The reasons, with core's appended. */ public function blockers( array $reasons, int $customerId ): array { $orders = $this->orders->countForCustomer( $customerId ); if ( $orders > 0 ) { $reasons[] = sprintf( /* translators: %d: the number of orders the customer has placed. */ _n( 'This customer has %d order. Use Tools then Erase Personal Data to remove their personal details, which keeps the order record for accounting.', 'This customer has %d orders. Use Tools then Erase Personal Data to remove their personal details, which keeps the order records for accounting.', $orders, 'releasecart' ), $orders ); } $live = $this->licenses->countForCustomer( $customerId, LicenseStatus::Disabled ); if ( $live > 0 ) { $reasons[] = sprintf( /* translators: %d: the number of licenses the customer holds that are not disabled. */ _n( 'This customer still holds %d license that is not disabled.', 'This customer still holds %d licenses that are not disabled.', $live, 'releasecart' ), $live ); } return $reasons; } }