Skip to content

Commit 3de0de0

Browse files
committed
Bit of naming consistency.
Signed-off-by: Jason Lewis <[email protected]>
1 parent 61182e6 commit 3de0de0

File tree

2 files changed

+10
-26
lines changed

2 files changed

+10
-26
lines changed

changes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

55
- Can now add cookies when using the response builder.
66

7+
#### Removed
8+
9+
- Removed `ResponseBuilder::addHeaders` and `ResponseBuilder::headers`.
10+
11+
#### Changed
12+
13+
- Changed `ResponseBuilder::addHeader` to `ResponseBuilder::withHeader`.
14+
715
### v0.7.3
816

917
#### Removed

src/Http/ResponseBuilder.php

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -125,26 +125,13 @@ public function cookie(Cookie $cookie)
125125
* @param string $value
126126
* @return \Dingo\Api\Http\ResponseBuilder
127127
*/
128-
public function addHeader($name, $value)
128+
public function withHeader($name, $value)
129129
{
130130
$this->headers[$name] = $value;
131131

132132
return $this;
133133
}
134134

135-
/**
136-
* Add an array of headers.
137-
*
138-
* @param array $headers
139-
* @return \Dingo\Api\Http\ResponseBuilder
140-
*/
141-
public function addHeaders(array $headers)
142-
{
143-
$this->headers = array_merge($this->headers, $headers);
144-
145-
return $this;
146-
}
147-
148135
/**
149136
* Add a header to the response.
150137
*
@@ -154,18 +141,7 @@ public function addHeaders(array $headers)
154141
*/
155142
public function header($name, $value)
156143
{
157-
return $this->addHeader($name, $value);
158-
}
159-
160-
/**
161-
* Add an array of headers.
162-
*
163-
* @param array $headers
164-
* @return \Dingo\Api\Http\ResponseBuilder
165-
*/
166-
public function headers(array $headers)
167-
{
168-
return $this->addHeaders($headers);
144+
return $this->withHeader($name, $value);
169145
}
170146

171147
/**

0 commit comments

Comments
 (0)