From 89923ed3452c8d8dccfbd6dec531ed75e30861e0 Mon Sep 17 00:00:00 2001 From: Thomas Kerin Date: Sat, 30 Dec 2017 00:23:53 +0000 Subject: [PATCH] use instanceof in Parser constructor --- src/Buffertools/Parser.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Buffertools/Parser.php b/src/Buffertools/Parser.php index 5ca477c..d66db2b 100644 --- a/src/Buffertools/Parser.php +++ b/src/Buffertools/Parser.php @@ -11,7 +11,7 @@ class Parser /** * @var string */ - private $string; + private $string = ''; /** * @var int @@ -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(); }