Skip to content
Permalink
Browse files

Renamed parameter to CakeResponse::cookie() to match cakephp standard…

… naming.
  • Loading branch information...
Thomas Ploch
Thomas Ploch committed Feb 13, 2012
1 parent 574b5dc commit 1a07f55d43f893aa267c3ec6e20c6194d8d06c25
Showing with 11 additions and 8 deletions.
  1. +11 −8 lib/Cake/Network/CakeResponse.php
@@ -1098,6 +1098,9 @@ public function __toString() {
* If the method is called with an array as argument, it will set the cookie
* configuration to the cookie container.
*
* @param $options Either null to get all cookies, string for a specific cookie
* or array to set cookie.
*
* ### Options (when setting a configuration)
* - name: The Cookie name
* - value: Value of the cookie
@@ -1119,20 +1122,20 @@ public function __toString() {
*
* ### Setting a cookie configuration
*
* `$this->cookie((array) $config)`
* `$this->cookie((array) $options)`
*
* @return mixed
*/
public function cookie($config = null) {
if ($config === null) {
public function cookie($options = null) {
if ($options === null) {
return $this->_cookies;
}
if (is_string($config)) {
if (!isset($this->_cookies[$config])) {
if (is_string($options)) {
if (!isset($this->_cookies[$options])) {
return null;
}
return $this->_cookies[$config];
return $this->_cookies[$options];
}
$defaults = array(
@@ -1144,8 +1147,8 @@ public function cookie($config = null) {
'secure' => false,
'httpOnly' => false
);
$config += $defaults;
$options += $defaults;
$this->_cookies[$config['name']] = $config;
$this->_cookies[$options['name']] = $options;
}
}

0 comments on commit 1a07f55

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