Skip to content

Commit a7577ec

Browse files
author
Thomas Kerin
committed
use instanceof in Parser constructor
1 parent 06074e8 commit a7577ec

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Buffertools/Parser.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@ class Parser
3030
*/
3131
public function __construct(BufferInterface $input = null)
3232
{
33-
$this->position = 0;
34-
35-
if (null === $input) {
36-
$this->string = '';
37-
$this->size = 0;
38-
} else {
33+
if ($input instanceof BufferInterface) {
3934
$this->string = $input->getBinary();
4035
$this->size = $input->getSize();
36+
} else {
37+
$this->string = '';
38+
$this->size = 0;
4139
}
4240
}
4341

0 commit comments

Comments
 (0)