code: public function getCustomerByEmail(string $customerEmail): array
      {
          $customers = $this->getListCustomersByEmail($customerEmail);
  
          if (count($customers) === 0) {
              throw new \LogicException(sprintf('customer with email %s not found', $customerEmail));
          }
  
          return $this->getCustomerById($customers[0]['customer_id']);
      }
docs: @param string $customerEmail
  
  @return array