Skip to content

Commit

Permalink
Readability changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jan 20, 2012
1 parent 5df2a09 commit 00a5510
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Cake/Network/CakeResponse.php
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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']);
}
Expand All @@ -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, ', ');
Expand Down

0 comments on commit 00a5510

Please sign in to comment.