Created
January 3, 2013 08:50
-
-
Save thewilkybarkid/4441924 to your computer and use it in GitHub Desktop.
See the PSR HTTP proposal at https://groups.google.com/forum/?hl=en#!topic/php-fig/73cM2qq_uho
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Psr\Http\Header; | |
use Countable, | |
Traversable; | |
/** | |
* A HTTP message header. | |
*/ | |
interface HeaderInterface extends Traversable, Countable | |
{ | |
/** | |
* Return the header in the format 'Name: Value, Value'. | |
* | |
* @return string Header as a string. | |
*/ | |
public function __toString(); | |
/** | |
* Gets the header name. | |
* | |
* @return string Header name. | |
*/ | |
public function getName(); | |
/** | |
* Sets the header name. | |
* | |
* @param string $name Header name. | |
* | |
* @return self Reference to the header. | |
*/ | |
public function setName($name); | |
/** | |
* Gets the header values. | |
* | |
* @return array Values. | |
*/ | |
public function all(); | |
/** | |
* Sets the header values. | |
* | |
* The value is a either an array of values, or a string containing | |
* comma-delimited values. | |
* | |
* A null value will remove all existing values. | |
* | |
* @param string|array $values Values. | |
* | |
* @return self Reference to the header. | |
*/ | |
public function set($values); | |
/** | |
* Adds a value to the header. | |
* | |
* @param string $value Value to add. | |
* | |
* @return self Reference to the header. | |
*/ | |
public function add($value); | |
/** | |
* Checks if a certain value is present. | |
* | |
* @param string $value Value. | |
* | |
* @return bool If the value is present. | |
*/ | |
public function contains($value); | |
/** | |
* Remove a specific value from the header. | |
* | |
* @param string $value Value to remove. | |
* | |
* @return self Reference to the header. | |
*/ | |
public function remove($value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment