Skip to content

Commit

Permalink
use instanceof in Parser constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Kerin committed Dec 30, 2017
1 parent 2c6f5ea commit 89923ed
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Buffertools/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Parser
/**
* @var string
*/
private $string;
private $string = '';

/**
* @var int
Expand All @@ -30,12 +30,7 @@ class Parser
*/
public function __construct(BufferInterface $input = null)
{
$this->position = 0;

if (null === $input) {
$this->string = '';
$this->size = 0;
} else {
if ($input instanceof BufferInterface) {
$this->string = $input->getBinary();
$this->size = $input->getSize();
}
Expand Down

0 comments on commit 89923ed

Please sign in to comment.