code: private function setSubjectState(StockSubjectInterface $subject, $state)
      {
          if ($subject->getStockState() != $state) {
              $subject->setStockState($state);
  
              return true;
          }
  
          return false;
      }
docs: Sets the subject's stock state.
  
  @param StockSubjectInterface $subject
  @param string                $state
  
  @return bool Whether the state has been changed.