original_string: public static function getDateWithMinOffsetFromToday($target, $workdayMinOffset, $inputFormat = 'd.m.Y', $today = null)
      {
          $targetDateObj = \DateTime::createFromFormat($inputFormat,$target);
  
          $earliestDate = self::getDateWithOffset($workdayMinOffset, $today, $inputFormat);
  
          if($targetDateObj === false || $earliestDate === false)
              return false;
  
          $earliestDateObj = new \DateTime($earliestDate);
  
          $isTargetDay = self::dateIsTargetDay($targetDateObj);
          while( !$isTargetDay )
          {
              $targetDateObj->modify('+1 day');
              $isTargetDay = self::dateIsTargetDay($targetDateObj);
          }
  
          if(strcmp($targetDateObj->format('Y-m-d'),$earliestDateObj->format('Y-m-d')) > 0)      // target > earliest?
              return $targetDateObj->format('Y-m-d');
          else
              return $earliestDateObj->format('Y-m-d');
      }
code: public static function getDateWithMinOffsetFromToday($target, $workdayMinOffset, $inputFormat = 'd.m.Y', $today = null)
      {
          $targetDateObj = \DateTime::createFromFormat($inputFormat,$target);
  
          $earliestDate = self::getDateWithOffset($workdayMinOffset, $today, $inputFormat);
  
          if($targetDateObj === false || $earliestDate === false)
              return false;
  
          $earliestDateObj = new \DateTime($earliestDate);
  
          $isTargetDay = self::dateIsTargetDay($targetDateObj);
          while( !$isTargetDay )
          {
              $targetDateObj->modify('+1 day');
              $isTargetDay = self::dateIsTargetDay($targetDateObj);
          }
  
          if(strcmp($targetDateObj->format('Y-m-d'),$earliestDateObj->format('Y-m-d')) > 0)      // target > earliest?
              return $targetDateObj->format('Y-m-d');
          else
              return $earliestDateObj->format('Y-m-d');
      }
code_tokens: public static function getDateWithMinOffsetFromToday ( $ target , $ workdayMinOffset , $ inputFormat = 'd.m.Y' , $ today = null ) { $ targetDateObj = \ DateTime :: createFromFormat ( $ inputFormat , $ target ) ; $ earliestDate = self :: getDateWithOffset ( $ workdayMinOffset , $ today , $ inputFormat ) ; if ( $ targetDateObj === false || $ earliestDate === false ) return false ; $ earliestDateObj = new \ DateTime ( $ earliestDate ) ; $ isTargetDay = self :: dateIsTargetDay ( $ targetDateObj ) ; while ( ! $ isTargetDay ) { $ targetDateObj -> modify ( '+1 day' ) ; $ isTargetDay = self :: dateIsTargetDay ( $ targetDateObj ) ; } if ( strcmp ( $ targetDateObj -> format ( 'Y-m-d' ) , $ earliestDateObj -> format ( 'Y-m-d' ) ) > 0 ) // target > earliest? return $ targetDateObj -> format ( 'Y-m-d' ) ; else return $ earliestDateObj -> format ( 'Y-m-d' ) ; }
docstring: Returns the target date, if it has at least the given offset of TARGET2 days form today. Else
  the earliest date that respects the offset is returned.
  
  @param string $target
  @param int    $workdayMinOffset
  @param string $inputFormat
  @param string $today
  @return string
docstring_tokens: Returns the target date if it has at least the given offset of TARGET2 days form today . Else the earliest date that respects the offset is returned .