Code Duplication    Length = 8-8 lines in 2 locations

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

@@ 420-427 (lines=8) @@
417
	/**
418
	 * {@inheritdoc}
419
	 */
420
	public function subscribe(Mqtt\Subscription $subscription) : Promise\ExtendedPromiseInterface
421
	{
422
		if (!$this->isConnected) {
423
			return new Promise\RejectedPromise(new Exceptions\LogicException('The client is not connected.'));
424
		}
425
426
		return $this->startFlow(new Mqtt\Flow\OutgoingSubscribeFlow([$subscription], $this->identifierGenerator));
427
	}
428
429
	/**
430
	 * {@inheritdoc}
@@ 432-439 (lines=8) @@
429
	/**
430
	 * {@inheritdoc}
431
	 */
432
	public function unsubscribe(Mqtt\Subscription $subscription) : Promise\ExtendedPromiseInterface
433
	{
434
		if (!$this->isConnected) {
435
			return new Promise\RejectedPromise(new Exceptions\LogicException('The client is not connected.'));
436
		}
437
438
		return $this->startFlow(new Mqtt\Flow\OutgoingUnsubscribeFlow([$subscription], $this->identifierGenerator));
439
	}
440
441
	/**
442
	 * {@inheritdoc}