code: private function setSubjectData(
          StockSubjectInterface $subject,
          $inStock = .0,
          $availableStock = .0,
          $virtualStock = .0,
          \DateTime $eda = null
      ) {
          $changed = false;
  
          if ($inStock != $subject->getInStock()) { // TODO use packaging format (bccomp for float)
              $subject->setInStock($inStock);
              $changed = true;
          }
  
          if ($availableStock != $subject->getAvailableStock()) { // TODO use packaging format (bccomp for float)
              $subject->setAvailableStock($availableStock);
              $changed = true;
          }
  
          if ($virtualStock != $subject->getVirtualStock()) { // TODO use packaging format (bccomp for float)
              $subject->setVirtualStock($virtualStock);
              $changed = true;
          }
  
          if ($eda !== $subject->getEstimatedDateOfArrival()) {
              $subject->setEstimatedDateOfArrival($eda);
              $changed = true;
          }
  
          return $changed;
      }
docs: Sets the subject stock data.
  
  @param StockSubjectInterface $subject
  @param float                 $inStock
  @param float                 $availableStock
  @param float                 $virtualStock
  @param \DateTime|null        $eda
  
  @return bool Whether the data has been changed.