Code Duplication    Length = 16-16 lines in 2 locations

src/IPub/MQTTClient/Client/Client.php 2 locations

@@ 733-748 (lines=16) @@
730
		$deferred = new Promise\Deferred;
731
		$internalFlow = new Flow\Envelope($flow, $deferred, $packet, $isSilent);
732
733
		if ($packet !== NULL) {
734
			if ($this->writtenFlow !== NULL) {
735
				$this->sendingFlows[] = $internalFlow;
736
737
			} else {
738
				$this->stream->write($packet);
739
				$this->writtenFlow = $internalFlow;
740
741
				$this->handleSend();
742
			}
743
744
		} else {
745
			$this->loop->futureTick(function () use ($internalFlow) {
746
				$this->finishFlow($internalFlow);
747
			});
748
		}
749
750
		return $deferred->promise();
751
	}
@@ 772-787 (lines=16) @@
769
			return;
770
		}
771
772
		if ($response !== NULL) {
773
			if ($this->writtenFlow !== NULL) {
774
				$this->sendingFlows[] = $flow;
775
776
			} else {
777
				$this->stream->write($response);
778
				$this->writtenFlow = $flow;
779
780
				$this->handleSend();
781
			}
782
783
		} elseif ($flow->isFinished()) {
784
			$this->loop->futureTick(function () use ($flow) {
785
				$this->finishFlow($flow);
786
			});
787
		}
788
	}
789
790
	/**