original_string: public function isVisitNew(VisitProperties $visitProperties, Request $request)
      {
          $isKnown = $request->getMetadata('CoreHome', 'isVisitorKnown');
          if (!$isKnown) {
              return true;
          }
  
          $isLastActionInTheSameVisit = $this->isLastActionInTheSameVisit($visitProperties, $request);
          if (!$isLastActionInTheSameVisit) {
              Common::printDebug("Visitor detected, but last action was more than 30 minutes ago...");
  
              return true;
          }
  
          $wasLastActionYesterday = $this->wasLastActionNotToday($visitProperties, $request);
          $forceNewVisitAtMidnight = (bool) Config::getInstance()->Tracker['create_new_visit_after_midnight'];
  
          if ($wasLastActionYesterday && $forceNewVisitAtMidnight) {
              Common::printDebug("Visitor detected, but last action was yesterday...");
  
              return true;
          }
  
          return false;
      }
code: public function isVisitNew(VisitProperties $visitProperties, Request $request)
      {
          $isKnown = $request->getMetadata('CoreHome', 'isVisitorKnown');
          if (!$isKnown) {
              return true;
          }
  
          $isLastActionInTheSameVisit = $this->isLastActionInTheSameVisit($visitProperties, $request);
          if (!$isLastActionInTheSameVisit) {
              Common::printDebug("Visitor detected, but last action was more than 30 minutes ago...");
  
              return true;
          }
  
          $wasLastActionYesterday = $this->wasLastActionNotToday($visitProperties, $request);
          $forceNewVisitAtMidnight = (bool) Config::getInstance()->Tracker['create_new_visit_after_midnight'];
  
          if ($wasLastActionYesterday && $forceNewVisitAtMidnight) {
              Common::printDebug("Visitor detected, but last action was yesterday...");
  
              return true;
          }
  
          return false;
      }
code_tokens: public function isVisitNew ( VisitProperties $ visitProperties , Request $ request ) { $ isKnown = $ request -> getMetadata ( 'CoreHome' , 'isVisitorKnown' ) ; if ( ! $ isKnown ) { return true ; } $ isLastActionInTheSameVisit = $ this -> isLastActionInTheSameVisit ( $ visitProperties , $ request ) ; if ( ! $ isLastActionInTheSameVisit ) { Common :: printDebug ( "Visitor detected, but last action was more than 30 minutes ago..." ) ; return true ; } $ wasLastActionYesterday = $ this -> wasLastActionNotToday ( $ visitProperties , $ request ) ; $ forceNewVisitAtMidnight = ( bool ) Config :: getInstance ( ) -> Tracker [ 'create_new_visit_after_midnight' ] ; if ( $ wasLastActionYesterday && $ forceNewVisitAtMidnight ) { Common :: printDebug ( "Visitor detected, but last action was yesterday..." ) ; return true ; } return false ; }
docstring: Determines if the tracker if the current action should be treated as the start of a new visit or
  an action in an existing visit.
  
  Note: public only for tests.
  
  @param VisitProperties $visitProperties The current visit/visitor information.
  @param Request $request
  @return bool
docstring_tokens: Determines if the tracker if the current action should be treated as the start of a new visit or an action in an existing visit .