Last active
December 10, 2015 13:38
-
-
Save thewilkybarkid/4442127 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; | |
/** | |
* HTTP message header. | |
*/ | |
interface HeaderInterface | |
{ | |
/** | |
* Return the header in the format 'Name: 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 value. | |
* | |
* @return string Value. | |
*/ | |
public function value(); | |
/** | |
* Sets the header value. | |
* | |
* A null value will remove an existing value. | |
* | |
* @param string|array $value Value. | |
* | |
* @return self Reference to the header. | |
*/ | |
public function set($value); | |
} |
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; | |
/** | |
* HTTP message header that can contain more than one value. | |
*/ | |
interface MultiValueHeaderInterface extends HeaderInterface, Traversable, Countable | |
{ | |
/** | |
* Return the header in the format 'Name: Value, Value'. | |
* | |
* @return string Header as a string. | |
*/ | |
public function __toString(); | |
/** | |
* Gets the header value in the format 'Value, Value'. | |
* | |
* @return string Value. | |
*/ | |
public function value(); | |
/** | |
* 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