Code Duplication    Length = 8-8 lines in 2 locations

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

@@ 417-424 (lines=8) @@
414
	/**
415
	 * {@inheritdoc}
416
	 */
417
	public function subscribe(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\OutgoingSubscribeFlow([$subscription], $this->identifierGenerator));
424
	}
425
426
	/**
427
	 * {@inheritdoc}
@@ 429-436 (lines=8) @@
426
	/**
427
	 * {@inheritdoc}
428
	 */
429
	public function unsubscribe(Mqtt\Subscription $subscription) : Promise\ExtendedPromiseInterface
430
	{
431
		if (!$this->isConnected) {
432
			return new Promise\RejectedPromise(new Exceptions\LogicException('The client is not connected.'));
433
		}
434
435
		return $this->startFlow(new Mqtt\Flow\OutgoingUnsubscribeFlow([$subscription], $this->identifierGenerator));
436
	}
437
438
	/**
439
	 * {@inheritdoc}