Skip to content

Commit 89923ed

Browse files
author
Thomas Kerin
committed
use instanceof in Parser constructor
1 parent 2c6f5ea commit 89923ed

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/Buffertools/Parser.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Parser
1111
/**
1212
* @var string
1313
*/
14-
private $string;
14+
private $string = '';
1515

1616
/**
1717
* @var int
@@ -30,12 +30,7 @@ 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();
4136
}

0 commit comments

Comments
 (0)