-
-
Notifications
You must be signed in to change notification settings - Fork 57
Initial support #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
999be72
47c6564
6a4ab9b
1ed3bff
1b81ee0
1e3307c
7e7fbf6
43d4c48
bb43a07
656318b
40c2973
a246407
77360d6
6f5815b
5240539
8b4a078
14dac4e
8c3c90e
65261ee
7e44bc2
1e480a9
9127c84
b360068
4d11665
e129154
91a13dc
ef384ae
bcfa698
8a2bd7b
f41f3e4
9c6f180
7d8bdc8
eacce8f
7012db5
b887c36
ca2ea3b
577e633
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,9 +16,11 @@ class Message implements MessageInterface | |
private $headers = array(); | ||
private $body; | ||
|
||
public function __construct() | ||
public function __construct($version = '1.1', array $headers = array(), StreamInterface $body = null) | ||
{ | ||
$this->body = new Stream(); | ||
$this->version = $version; | ||
$this->headers = $headers; | ||
$this->body = null === $body ? new Stream() : $body; | ||
} | ||
|
||
public function getProtocolVersion() | ||
|
@@ -28,7 +30,7 @@ public function getProtocolVersion() | |
|
||
public function withProtocolVersion($version) | ||
{ | ||
$this->version = $version; | ||
throw \BadMethodCallException('Not implemented.'); | ||
} | ||
|
||
public function getHeaders() | ||
|
@@ -53,23 +55,17 @@ public function getHeaderLine($name) | |
|
||
public function withHeader($name, $value) | ||
{ | ||
if (!is_array($value)) { | ||
$value = array($value); | ||
} | ||
|
||
$this->headers[$name] = $value; | ||
throw \BadMethodCallException('Not implemented.'); | ||
} | ||
|
||
public function withAddedHeader($name, $value) | ||
{ | ||
$this->headers[$name][] = $value; | ||
throw \BadMethodCallException('Not implemented.'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. throw new \BadMethodCallException('Not implemented.'); |
||
} | ||
|
||
public function withoutHeader($name) | ||
{ | ||
if ($this->hasHeader($name)) { | ||
unset($this->headers[$name]); | ||
} | ||
throw \BadMethodCallException('Not implemented.'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. throw new \BadMethodCallException('Not implemented.'); |
||
} | ||
|
||
public function getBody() | ||
|
@@ -79,6 +75,6 @@ public function getBody() | |
|
||
public function withBody(StreamInterface $body) | ||
{ | ||
$this->body = $body; | ||
throw \BadMethodCallException('Not implemented.'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. throw new \BadMethodCallException('Not implemented.'); |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw new \BadMethodCallException('Not implemented.');