Skip to content

Commit

Permalink
Rename 'add' to 'set'
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Jan 28, 2015
1 parent a4f598d commit f995533
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Response/Headers.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,20 @@ public static function code($code = null) {
*
* @return string The raw header, as it is sent over HTTP
*/
public static function add($field, $value) {
public static function set($field, $value) {
$field = ucfirst($field);
self::$headerArray[$field] = $value;

return self::getRaw($field, $value);
}

/**
* Synonym function for set.
*/
public static function add($field, $value) {
return self::set($field, $value);
}

/**
* Return the value of the header with the given field name.
*
Expand Down Expand Up @@ -113,7 +120,7 @@ public static function getRaw($field, $value) {

public static function redirect($uri,
$code = ResponseCode::REDIRECT_TEMPORARY) {
self::add("Location", $uri);
self::set("Location", $uri);
self::code($code);
self::send();
}
Expand Down

0 comments on commit f995533

Please sign in to comment.