original_string: protected function get_hidden_post_sql(bool $includehiddendiscussions, ?int $includepostsforuser) {
          $wheresql = '';
          $params = [];
          if (!$includehiddendiscussions) {
              $now = time();
              $wheresql = " AND ((d.timestart <= :timestart AND (d.timeend = 0 OR d.timeend > :timeend))";
              $params['timestart'] = $now;
              $params['timeend'] = $now;
              if (null !== $includepostsforuser) {
                  $wheresql .= " OR d.userid = :byuser";
                  $params['byuser'] = $includepostsforuser;
              }
              $wheresql .= ")";
          }
  
          return [
              'wheresql' => $wheresql,
              'params' => $params,
          ];
      }
code: protected function get_hidden_post_sql(bool $includehiddendiscussions, ?int $includepostsforuser) {
          $wheresql = '';
          $params = [];
          if (!$includehiddendiscussions) {
              $now = time();
              $wheresql = " AND ((d.timestart <= :timestart AND (d.timeend = 0 OR d.timeend > :timeend))";
              $params['timestart'] = $now;
              $params['timeend'] = $now;
              if (null !== $includepostsforuser) {
                  $wheresql .= " OR d.userid = :byuser";
                  $params['byuser'] = $includepostsforuser;
              }
              $wheresql .= ")";
          }
  
          return [
              'wheresql' => $wheresql,
              'params' => $params,
          ];
      }
code_tokens: protected function get_hidden_post_sql ( bool $ includehiddendiscussions , ? int $ includepostsforuser ) { $ wheresql = '' ; $ params = [ ] ; if ( ! $ includehiddendiscussions ) { $ now = time ( ) ; $ wheresql = " AND ((d.timestart <= :timestart AND (d.timeend = 0 OR d.timeend > :timeend))" ; $ params [ 'timestart' ] = $ now ; $ params [ 'timeend' ] = $ now ; if ( null !== $ includepostsforuser ) { $ wheresql .= " OR d.userid = :byuser" ; $ params [ 'byuser' ] = $ includepostsforuser ; } $ wheresql .= ")" ; } return [ 'wheresql' => $ wheresql , 'params' => $ params , ] ; }
docstring: Fetch any required SQL to respect timed posts.
  
  @param   bool        $includehiddendiscussions Whether to include hidden discussions or not
  @param   int|null    $includepostsforuser Which user to include posts for, if any
  @return  array       The SQL and parameters to include
docstring_tokens: Fetch any required SQL to respect timed posts .