Skip to content
Permalink
Browse files

Readability changes

  • Loading branch information...
lorenzo committed Jan 20, 2012
1 parent 5df2a09 commit 00a5510b1deadc5960e50e82acd94bc7f5553f2c
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/Cake/Network/CakeResponse.php
@@ -713,11 +713,11 @@ public function sharable($public = null, $time = null) {
return $sharable;
}
if ($public) {
$this->_cacheDirectives['public'] = null;
$this->_cacheDirectives['public'] = true;
unset($this->_cacheDirectives['private']);
$this->sharedMaxAge($time);
} else {
$this->_cacheDirectives['private'] = null;
$this->_cacheDirectives['private'] = true;
unset($this->_cacheDirectives['public']);
$this->maxAge($time);
}
@@ -781,7 +781,7 @@ public function maxAge($seconds = null) {
public function mustRevalidate($enable = null) {
if ($enable !== null) {
if ($enable) {
$this->_cacheDirectives['must-revalidate'] = null;
$this->_cacheDirectives['must-revalidate'] = true;
} else {
unset($this->_cacheDirectives['must-revalidate']);
}
@@ -799,7 +799,7 @@ public function mustRevalidate($enable = null) {
protected function _setCacheControl() {
$control = '';
foreach ($this->_cacheDirectives as $key => $val) {
$control .= is_null($val) ? $key : sprintf('%s=%s', $key, $val);
$control .= $val === true ? $key : sprintf('%s=%s', $key, $val);
$control .= ', ';
}
$control = rtrim($control, ', ');

0 comments on commit 00a5510

Please sign in to comment.
You can’t perform that action at this time.