Passed
Push — master ( 958a85...6386e9 )
by Adam
50s queued 10s
created

UnsubscribeEvent::getSubscription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * UnsubscribeEvent.php
4
 *
5
 * @copyright      More in license.md
6
 * @license        https://www.ipublikuj.eu
7
 * @author         Adam Kadlec <[email protected]>
8
 * @package        iPublikuj:MQTTClient!
9
 * @subpackage     Events
10
 * @since          1.0.0
11
 *
12
 * @date           14.11.19
13
 */
14
15
namespace IPub\MQTTClient\Events;
16
17
use Symfony\Contracts\EventDispatcher;
18
19
use BinSoul\Net\Mqtt;
20
21
use IPub\MQTTClient\Client;
22
23
/**
24
 * Unsubscribe to topic event
25
 *
26
 * @package        iPublikuj:MQTTClient!
27
 * @subpackage     Events
28
 *
29
 * @author         Adam Kadlec <[email protected]>
30
 */
31 View Code Duplication
final class UnsubscribeEvent extends EventDispatcher\Event
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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
0 ignored issues
show
Bug introduced by
There is no parameter named $message. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
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