getCoupons(), static fn(array $coupon): bool => $coupon['status'] === 'available' )); } public function getUnavailableCoupons(): array { return array_values(array_filter( $this->getCoupons(), static fn(array $coupon): bool => $coupon['status'] !== 'available' )); } private function getCoupons(): array { if ($this->coupons === null) { $this->coupons = $this->listProvider->getForCustomer( (int)$this->customerSession->getCustomerId(), (int)$this->storeManager->getStore()->getWebsiteId(), (int)$this->customerSession->getCustomerGroupId() ); } return $this->coupons; } }