code: private function getShippingTime(array $variation)
      {
          static $shippingConfigurations;
  
          if (null === $shippingConfigurations) {
              $shippingConfigurations = $this->availabilitiesApi->findAll();
          }
  
          $shippingConfiguration = array_filter($shippingConfigurations, function (array $configuration) use ($variation) {
              return $configuration['id'] === $variation['availability'];
          });
  
          if (empty($shippingConfiguration)) {
              return 0;
          }
  
          $shippingConfiguration = array_shift($shippingConfiguration);
  
          if (empty($shippingConfiguration['averageDays'])) {
              return 0;
          }
  
          return (int) $shippingConfiguration['averageDays'];
      }
docs: @param array $variation
  
  @return int