Skip to content

Commit d0519e1

Browse files
committed
Simplify interaction with Parser
1 parent 2eea95d commit d0519e1

2 files changed

Lines changed: 0 additions & 10 deletions

File tree

src/Client.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
class Client extends EventEmitter
1616
{
1717
private $stream;
18-
private $parser;
1918

2019
private $pending = array();
2120
private $ending = false;
@@ -26,7 +25,6 @@ public function __construct(Stream $stream, Parser $parser = null)
2625
$parser = new Parser();
2726
}
2827
$this->stream = $stream;
29-
$this->parser = $parser;
3028

3129
$that = $this;
3230
$this->stream->on('data', function ($chunk) use ($parser, $that) {
@@ -96,9 +94,6 @@ public function close()
9694

9795
$this->emit('close', array($this));
9896

99-
$this->parser->clear();
100-
$this->parser = null;
101-
10297
// reject all remaining/pending requests
10398
foreach ($this->pending as $deferred) {
10499
$deferred->reject(new Exception('Client closing'));

src/Protocol/Parser.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,4 @@ private function parseMessage($message)
7070

7171
return new Response($parts);
7272
}
73-
74-
public function clear()
75-
{
76-
$this->buffer = '';
77-
}
7873
}

0 commit comments

Comments
 (0)