Code Duplication    Length = 8-8 lines in 2 locations

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

@@ 405-412 (lines=8) @@
402
	/**
403
	 * {@inheritdoc}
404
	 */
405
	public function subscribe(Mqtt\Subscription $subscription) : Promise\ExtendedPromiseInterface
406
	{
407
		if (!$this->isConnected) {
408
			return new Promise\RejectedPromise(new Exceptions\LogicException('The client is not connected.'));
409
		}
410
411
		return $this->startFlow(new Mqtt\Flow\OutgoingSubscribeFlow([$subscription], $this->identifierGenerator));
412
	}
413
414
	/**
415
	 * {@inheritdoc}
@@ 417-424 (lines=8) @@
414
	/**
415
	 * {@inheritdoc}
416
	 */
417
	public function unsubscribe(Mqtt\Subscription $subscription) : Promise\ExtendedPromiseInterface
418
	{
419
		if (!$this->isConnected) {
420
			return new Promise\RejectedPromise(new Exceptions\LogicException('The client is not connected.'));
421
		}
422
423
		return $this->startFlow(new Mqtt\Flow\OutgoingUnsubscribeFlow([$subscription], $this->identifierGenerator));
424
	}
425
426
	/**
427
	 * {@inheritdoc}