@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Dazzle\Http\Socket\Component\Firewall; |
4 | 4 | |
5 | -use Dazzle\Http\Null\NullServer; |
|
5 | +use Dazzle\Http\null\NullServer; |
|
6 | 6 | use Dazzle\Http\NetworkComponentAwareInterface; |
7 | 7 | use Dazzle\Http\NetworkConnectionInterface; |
8 | 8 | use Dazzle\Http\NetworkMessageInterface; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $this->socket = $socket; |
34 | 34 | $this->component = $component === null ? new NullServer() : $component; |
35 | 35 | |
36 | - $socket->on('connect', [ $this, 'handleConnect' ]); |
|
36 | + $socket->on('connect', [$this, 'handleConnect']); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | { |
96 | 96 | $this->component->handleConnect($socket->conn); |
97 | 97 | |
98 | - $socket->on('data', [ $this, 'handleData' ]); |
|
99 | - $socket->on('error', [ $this, 'handleError' ]); |
|
100 | - $socket->on('close', [ $this, 'handleDisconnect' ]); |
|
98 | + $socket->on('data', [$this, 'handleData']); |
|
99 | + $socket->on('error', [$this, 'handleError']); |
|
100 | + $socket->on('close', [$this, 'handleDisconnect']); |
|
101 | 101 | } |
102 | 102 | catch (Error $ex) |
103 | 103 | { |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Dazzle\Socket\SocketInterface; |
5 | 5 | use Dazzle\Socket\SocketListenerInterface; |
6 | -use Dazzle\Http\Null\NullServer; |
|
6 | +use Dazzle\Http\null\NullServer; |
|
7 | 7 | use Dazzle\Http\NetworkComponentAwareInterface; |
8 | 8 | use Dazzle\Http\NetworkConnection; |
9 | 9 | use Dazzle\Http\NetworkMessage; |
@@ -153,8 +153,8 @@ |
||
153 | 153 | $path, |
154 | 154 | new Route( |
155 | 155 | $path, |
156 | - [ '_controller' => $component ], |
|
157 | - $this->checkOrigin ? [ 'Origin' => $this->host ] : [], |
|
156 | + ['_controller' => $component], |
|
157 | + $this->checkOrigin ? ['Origin' => $this->host] : [], |
|
158 | 158 | [], |
159 | 159 | $this->checkOrigin ? $this->host : '' |
160 | 160 | ) |
@@ -179,7 +179,8 @@ discard block |
||
179 | 179 | * @inheritDoc |
180 | 180 | */ |
181 | 181 | public function handleConnect(NetworkConnectionInterface $conn) |
182 | - {} |
|
182 | + { |
|
183 | +} |
|
183 | 184 | |
184 | 185 | /** |
185 | 186 | * @override |
@@ -254,9 +255,11 @@ discard block |
||
254 | 255 | return; |
255 | 256 | } |
256 | 257 | catch (Error $ex) |
257 | - {} |
|
258 | + { |
|
259 | +} |
|
258 | 260 | catch (Exception $ex) |
259 | - {} |
|
261 | + { |
|
262 | +} |
|
260 | 263 | |
261 | 264 | $conn->controller->handleError($conn, $ex); |
262 | 265 | } |
@@ -274,9 +277,11 @@ discard block |
||
274 | 277 | return $conn->controller->handleError($conn, $ex); |
275 | 278 | } |
276 | 279 | catch (Error $ex) |
277 | - {} |
|
280 | + { |
|
281 | +} |
|
278 | 282 | catch (Exception $ex) |
279 | - {} |
|
283 | + { |
|
284 | +} |
|
280 | 285 | } |
281 | 286 | |
282 | 287 | $this->close($conn, 500); |
@@ -79,7 +79,7 @@ |
||
79 | 79 | { |
80 | 80 | return preg_replace_callback( |
81 | 81 | '/(?:[^A-Za-z0-9_\-\.~!\$&\'\(\)\[\]\*\+,:;=\/% ]+|%(?![A-Fa-f0-9]{2}))/', |
82 | - function (array $matches) { |
|
82 | + function(array $matches) { |
|
83 | 83 | return rawurlencode($matches[0]); |
84 | 84 | }, |
85 | 85 | $header |
@@ -84,9 +84,11 @@ discard block |
||
84 | 84 | return $this->parser->parseRequest($buffer->drain()); |
85 | 85 | } |
86 | 86 | catch (Error $ex) |
87 | - {} |
|
87 | + { |
|
88 | +} |
|
88 | 89 | catch (Exception $ex) |
89 | - {} |
|
90 | + { |
|
91 | +} |
|
90 | 92 | |
91 | 93 | throw new InvalidFormatException('Could not parse start line.', 0, $ex); |
92 | 94 | } |
@@ -116,9 +118,11 @@ discard block |
||
116 | 118 | return $this->parser->parseResponse($buffer->drain()); |
117 | 119 | } |
118 | 120 | catch (Error $ex) |
119 | - {} |
|
121 | + { |
|
122 | +} |
|
120 | 123 | catch (Exception $ex) |
121 | - {} |
|
124 | + { |
|
125 | +} |
|
122 | 126 | |
123 | 127 | throw new InvalidFormatException('Could not parse start line.'); |
124 | 128 | } |
@@ -5,4 +5,5 @@ |
||
5 | 5 | use Dazzle\Http\Http\Driver\Reader\HttpReaderInterface; |
6 | 6 | |
7 | 7 | interface HttpDriverInterface extends HttpReaderInterface |
8 | -{} |
|
8 | +{ |
|
9 | +} |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Dazzle\Http\NetworkComponentAwareInterface; |
6 | 6 | use Dazzle\Http\Http\Driver\HttpDriver; |
7 | 7 | use Dazzle\Http\Http\Driver\HttpDriverInterface; |
8 | -use Dazzle\Http\Null\NullServer; |
|
8 | +use Dazzle\Http\null\NullServer; |
|
9 | 9 | use Dazzle\Http\NetworkMessageInterface; |
10 | 10 | use Dazzle\Http\NetworkComponentInterface; |
11 | 11 | use Dazzle\Http\NetworkConnectionInterface; |
@@ -13,26 +13,30 @@ |
||
13 | 13 | * @inheritDoc |
14 | 14 | */ |
15 | 15 | public function handleConnect(NetworkConnectionInterface $conn) |
16 | - {} |
|
16 | + { |
|
17 | +} |
|
17 | 18 | |
18 | 19 | /** |
19 | 20 | * @override |
20 | 21 | * @inheritDoc |
21 | 22 | */ |
22 | 23 | public function handleDisconnect(NetworkConnectionInterface $conn) |
23 | - {} |
|
24 | + { |
|
25 | +} |
|
24 | 26 | |
25 | 27 | /** |
26 | 28 | * @override |
27 | 29 | * @inheritDoc |
28 | 30 | */ |
29 | 31 | public function handleMessage(NetworkConnectionInterface $conn, NetworkMessageInterface $message) |
30 | - {} |
|
32 | + { |
|
33 | +} |
|
31 | 34 | |
32 | 35 | /** |
33 | 36 | * @override |
34 | 37 | * @inheritDoc |
35 | 38 | */ |
36 | 39 | public function handleError(NetworkConnectionInterface $conn, $ex) |
37 | - {} |
|
40 | + { |
|
41 | +} |
|
38 | 42 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -namespace Dazzle\Http\Null; |
|
3 | +namespace Dazzle\Http\null; |
|
4 | 4 | |
5 | 5 | use Dazzle\Http\NetworkMessageInterface; |
6 | 6 | use Dazzle\Http\NetworkComponentInterface; |
@@ -82,7 +82,7 @@ |
||
82 | 82 | */ |
83 | 83 | public function send($data) |
84 | 84 | { |
85 | - $this->conn->write((string)$data); |
|
85 | + $this->conn->write((string) $data); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |