original_string: public function has_user_read_post(stdClass $user, post_entity $post) : bool {
          global $CFG;
          $isoldpost = ($post->get_time_modified() < (time() - ($CFG->forum_oldpostdays * 24 * 3600)));
  
          if ($isoldpost) {
              return true;
          }
  
          $receipts = isset($this->receiptsbypostid[$post->get_id()]) ? $this->receiptsbypostid[$post->get_id()] : [];
  
          foreach ($receipts as $receipt) {
              if ($receipt->userid == $user->id) {
                  return true;
              }
          }
  
          return false;
      }
code: public function has_user_read_post(stdClass $user, post_entity $post) : bool {
          global $CFG;
          $isoldpost = ($post->get_time_modified() < (time() - ($CFG->forum_oldpostdays * 24 * 3600)));
  
          if ($isoldpost) {
              return true;
          }
  
          $receipts = isset($this->receiptsbypostid[$post->get_id()]) ? $this->receiptsbypostid[$post->get_id()] : [];
  
          foreach ($receipts as $receipt) {
              if ($receipt->userid == $user->id) {
                  return true;
              }
          }
  
          return false;
      }
code_tokens: public function has_user_read_post ( stdClass $ user , post_entity $ post ) : bool { global $ CFG ; $ isoldpost = ( $ post -> get_time_modified ( ) < ( time ( ) - ( $ CFG -> forum_oldpostdays * 24 * 3600 ) ) ) ; if ( $ isoldpost ) { return true ; } $ receipts = isset ( $ this -> receiptsbypostid [ $ post -> get_id ( ) ] ) ? $ this -> receiptsbypostid [ $ post -> get_id ( ) ] : [ ] ; foreach ( $ receipts as $ receipt ) { if ( $ receipt -> userid == $ user -> id ) { return true ; } } return false ; }
docstring: Check whether a user has read a post.
  
  @param stdClass $user The user to check
  @param post_entity $post The post to check
  @return bool
docstring_tokens: Check whether a user has read a post .