Code Duplication    Length = 40-40 lines in 2 locations

src/IPub/MQTTClient/Events/SubscribeEvent.php 1 location

@@ 31-70 (lines=40) @@
28
 *
29
 * @author         Adam Kadlec <[email protected]>
30
 */
31
final class SubscribeEvent extends EventDispatcher\Event
32
{
33
	/**
34
	 * @var Mqtt\Subscription
35
	 */
36
	private $subscription;
37
38
	/**
39
	 * @var Client\IClient
40
	 */
41
	private $client;
42
43
	/**
44
	 * @param Mqtt\Message $message
45
	 * @param Client\IClient $client
46
	 */
47
	public function __construct(
48
		Mqtt\Subscription $subscription,
49
		Client\IClient $client
50
	) {
51
		$this->subscription = $subscription;
52
		$this->client = $client;
53
	}
54
55
	/**
56
	 * @return Mqtt\Subscription
57
	 */
58
	public function getSubscription() : Mqtt\Subscription
59
	{
60
		return $this->subscription;
61
	}
62
63
	/**
64
	 * @return Client\IClient
65
	 */
66
	public function getClient() : Client\IClient
67
	{
68
		return $this->client;
69
	}
70
}
71

src/IPub/MQTTClient/Events/UnsubscribeEvent.php 1 location

@@ 31-70 (lines=40) @@
28
 *
29
 * @author         Adam Kadlec <[email protected]>
30
 */
31
final class UnsubscribeEvent extends EventDispatcher\Event
32
{
33
	/**
34
	 * @var Mqtt\Subscription
35
	 */
36
	private $subscription;
37
38
	/**
39
	 * @var Client\IClient
40
	 */
41
	private $client;
42
43
	/**
44
	 * @param Mqtt\Message $message
45
	 * @param Client\IClient $client
46
	 */
47
	public function __construct(
48
		Mqtt\Subscription $subscription,
49
		Client\IClient $client
50
	) {
51
		$this->subscription = $subscription;
52
		$this->client = $client;
53
	}
54
55
	/**
56
	 * @return Mqtt\Subscription
57
	 */
58
	public function getSubscription() : Mqtt\Subscription
59
	{
60
		return $this->subscription;
61
	}
62
63
	/**
64
	 * @return Client\IClient
65
	 */
66
	public function getClient() : Client\IClient
67
	{
68
		return $this->client;
69
	}
70
}
71