@@ -32,7 +32,9 @@ |
||
| 32 | 32 | |
| 33 | 33 | $location = $this->response->getLocation()->get(); |
| 34 | 34 | |
| 35 | - if (empty($location)) throw new Exception("Invalid location, cannot redirect"); |
|
| 35 | + if (empty($location)) { |
|
| 36 | + throw new Exception("Invalid location, cannot redirect"); |
|
| 37 | + } |
|
| 36 | 38 | |
| 37 | 39 | $this->response->getHeaders()->set("Location", $location); |
| 38 | 40 | |
@@ -33,7 +33,9 @@ |
||
| 33 | 33 | // An Allow Header should be provided from DispatcherException |
| 34 | 34 | $allow = $this->response->getHeaders()->get('Allow'); |
| 35 | 35 | |
| 36 | - if (is_null($allow)) throw new Exception("Missing Allow header"); |
|
| 36 | + if (is_null($allow)) { |
|
| 37 | + throw new Exception("Missing Allow header"); |
|
| 38 | + } |
|
| 37 | 39 | |
| 38 | 40 | parent::consolidate(); |
| 39 | 41 | |
@@ -159,14 +159,24 @@ |
||
| 159 | 159 | |
| 160 | 160 | public function import($data) { |
| 161 | 161 | |
| 162 | - if (isset($data->headers)) $this->setHeaders($data->headers); |
|
| 163 | - if (isset($data->status)) $this->setStatus($data->status); |
|
| 164 | - if (isset($data->content)) $this->setContent($data->content); |
|
| 165 | - if (isset($data->location)) $this->setLocation($data->location); |
|
| 162 | + if (isset($data->headers)) { |
|
| 163 | + $this->setHeaders($data->headers); |
|
| 164 | + } |
|
| 165 | + if (isset($data->status)) { |
|
| 166 | + $this->setStatus($data->status); |
|
| 167 | + } |
|
| 168 | + if (isset($data->content)) { |
|
| 169 | + $this->setContent($data->content); |
|
| 170 | + } |
|
| 171 | + if (isset($data->location)) { |
|
| 172 | + $this->setLocation($data->location); |
|
| 173 | + } |
|
| 166 | 174 | |
| 167 | 175 | if (isset($data->cookies) && is_array($data->cookies)) { |
| 168 | 176 | $cookies = $this->getCookies(); |
| 169 | - foreach ($data->cookies as $name => $cookie) $cookies->add($cookie); |
|
| 177 | + foreach ($data->cookies as $name => $cookie) { |
|
| 178 | + $cookies->add($cookie); |
|
| 179 | + } |
|
| 170 | 180 | } |
| 171 | 181 | |
| 172 | 182 | } |