original_string: public function sharable($public = null, $time = null)
      {
          deprecationWarning(
              'Response::sharable() is deprecated. ' .
              'Use withSharable() instead.'
          );
          if ($public === null) {
              $public = array_key_exists('public', $this->_cacheDirectives);
              $private = array_key_exists('private', $this->_cacheDirectives);
              $noCache = array_key_exists('no-cache', $this->_cacheDirectives);
              if (!$public && !$private && !$noCache) {
                  return null;
              }
  
              return $public || !($private || $noCache);
          }
          if ($public) {
              $this->_cacheDirectives['public'] = true;
              unset($this->_cacheDirectives['private']);
          } else {
              $this->_cacheDirectives['private'] = true;
              unset($this->_cacheDirectives['public']);
          }
  
          $this->maxAge($time);
          if (!$time) {
              $this->_setCacheControl();
          }
  
          return (bool)$public;
      }
code: public function sharable($public = null, $time = null)
      {
          deprecationWarning(
              'Response::sharable() is deprecated. ' .
              'Use withSharable() instead.'
          );
          if ($public === null) {
              $public = array_key_exists('public', $this->_cacheDirectives);
              $private = array_key_exists('private', $this->_cacheDirectives);
              $noCache = array_key_exists('no-cache', $this->_cacheDirectives);
              if (!$public && !$private && !$noCache) {
                  return null;
              }
  
              return $public || !($private || $noCache);
          }
          if ($public) {
              $this->_cacheDirectives['public'] = true;
              unset($this->_cacheDirectives['private']);
          } else {
              $this->_cacheDirectives['private'] = true;
              unset($this->_cacheDirectives['public']);
          }
  
          $this->maxAge($time);
          if (!$time) {
              $this->_setCacheControl();
          }
  
          return (bool)$public;
      }
code_tokens: public function sharable ( $ public = null , $ time = null ) { deprecationWarning ( 'Response::sharable() is deprecated. ' . 'Use withSharable() instead.' ) ; if ( $ public === null ) { $ public = array_key_exists ( 'public' , $ this -> _cacheDirectives ) ; $ private = array_key_exists ( 'private' , $ this -> _cacheDirectives ) ; $ noCache = array_key_exists ( 'no-cache' , $ this -> _cacheDirectives ) ; if ( ! $ public && ! $ private && ! $ noCache ) { return null ; } return $ public || ! ( $ private || $ noCache ) ; } if ( $ public ) { $ this -> _cacheDirectives [ 'public' ] = true ; unset ( $ this -> _cacheDirectives [ 'private' ] ) ; } else { $ this -> _cacheDirectives [ 'private' ] = true ; unset ( $ this -> _cacheDirectives [ 'public' ] ) ; } $ this -> maxAge ( $ time ) ; if ( ! $ time ) { $ this -> _setCacheControl ( ) ; } return ( bool ) $ public ; }
docstring: Sets whether a response is eligible to be cached by intermediate proxies
  This method controls the `public` or `private` directive in the Cache-Control
  header
  
  @param bool|null $public If set to true, the Cache-Control header will be set as public
  if set to false, the response will be set to private
  if no value is provided, it will return whether the response is sharable or not
  @param int|null $time time in seconds after which the response should no longer be considered fresh
  @return bool|null
docstring_tokens: Sets whether a response is eligible to be cached by intermediate proxies This method controls the public or private directive in the Cache - Control header