These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * OpenEvent.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 | * Open connection event |
||
25 | * |
||
26 | * @package iPublikuj:MQTTClient! |
||
27 | * @subpackage Events |
||
28 | * |
||
29 | * @author Adam Kadlec <[email protected]> |
||
30 | */ |
||
31 | View Code Duplication | final class OpenEvent extends EventDispatcher\Event |
|
0 ignored issues
–
show
|
|||
32 | { |
||
33 | /** |
||
34 | * @var Mqtt\Connection |
||
35 | */ |
||
36 | private $connection; |
||
37 | |||
38 | /** |
||
39 | * @var Client\IClient |
||
40 | */ |
||
41 | private $client; |
||
42 | |||
43 | /** |
||
44 | * @param Mqtt\Connection $connection |
||
45 | * @param Client\IClient $client |
||
46 | */ |
||
47 | public function __construct( |
||
48 | Mqtt\Connection $connection, |
||
49 | Client\IClient $client |
||
50 | ) { |
||
51 | $this->connection = $connection; |
||
52 | $this->client = $client; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @return Mqtt\Connection |
||
57 | */ |
||
58 | public function getConnection() : Mqtt\Connection |
||
59 | { |
||
60 | return $this->connection; |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * @return Client\IClient |
||
65 | */ |
||
66 | public function getClient() : Client\IClient |
||
67 | { |
||
68 | return $this->client; |
||
69 | } |
||
70 | } |
||
71 |
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.