-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ipublikuj/symfonyevents
Task: Added support for symfony events
- Loading branch information
Showing
18 changed files
with
992 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
/** | ||
* CloseEvent.php | ||
* | ||
* @copyright More in license.md | ||
* @license https://www.ipublikuj.eu | ||
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu> | ||
* @package iPublikuj:MQTTClient! | ||
* @subpackage Events | ||
* @since 1.0.0 | ||
* | ||
* @date 14.11.19 | ||
*/ | ||
|
||
namespace IPub\MQTTClient\Events; | ||
|
||
use Symfony\Contracts\EventDispatcher; | ||
|
||
use BinSoul\Net\Mqtt; | ||
|
||
use IPub\MQTTClient\Client; | ||
|
||
/** | ||
* Connection close event | ||
* | ||
* @package iPublikuj:MQTTClient! | ||
* @subpackage Events | ||
* | ||
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu> | ||
*/ | ||
final class CloseEvent extends EventDispatcher\Event | ||
{ | ||
/** | ||
* @var Mqtt\Connection | ||
*/ | ||
private $connection; | ||
|
||
/** | ||
* @var Client\IClient | ||
*/ | ||
private $client; | ||
|
||
/** | ||
* @param Mqtt\Connection $connection | ||
* @param Client\IClient $client | ||
*/ | ||
public function __construct( | ||
Mqtt\Connection $connection, | ||
Client\IClient $client | ||
) { | ||
$this->connection = $connection; | ||
$this->client = $client; | ||
} | ||
|
||
/** | ||
* @return Mqtt\Connection | ||
*/ | ||
public function getConnection() : Mqtt\Connection | ||
{ | ||
return $this->connection; | ||
} | ||
|
||
/** | ||
* @return Client\IClient | ||
*/ | ||
public function getClient() : Client\IClient | ||
{ | ||
return $this->client; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
/** | ||
* ConnectEvent.php | ||
* | ||
* @copyright More in license.md | ||
* @license https://www.ipublikuj.eu | ||
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu> | ||
* @package iPublikuj:MQTTClient! | ||
* @subpackage Events | ||
* @since 1.0.0 | ||
* | ||
* @date 14.11.19 | ||
*/ | ||
|
||
namespace IPub\MQTTClient\Events; | ||
|
||
use Symfony\Contracts\EventDispatcher; | ||
|
||
use BinSoul\Net\Mqtt; | ||
|
||
use IPub\MQTTClient\Client; | ||
|
||
/** | ||
* Connected event | ||
* | ||
* @package iPublikuj:MQTTClient! | ||
* @subpackage Events | ||
* | ||
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu> | ||
*/ | ||
final class ConnectEvent extends EventDispatcher\Event | ||
{ | ||
/** | ||
* @var Mqtt\Connection | ||
*/ | ||
private $connection; | ||
|
||
/** | ||
* @var Client\IClient | ||
*/ | ||
private $client; | ||
|
||
/** | ||
* @param Mqtt\Connection $connection | ||
* @param Client\IClient $client | ||
*/ | ||
public function __construct( | ||
Mqtt\Connection $connection, | ||
Client\IClient $client | ||
) { | ||
$this->connection = $connection; | ||
$this->client = $client; | ||
} | ||
|
||
/** | ||
* @return Mqtt\Connection | ||
*/ | ||
public function getConnection() : Mqtt\Connection | ||
{ | ||
return $this->connection; | ||
} | ||
|
||
/** | ||
* @return Client\IClient | ||
*/ | ||
public function getClient() : Client\IClient | ||
{ | ||
return $this->client; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
/** | ||
* DisconnectEvent.php | ||
* | ||
* @copyright More in license.md | ||
* @license https://www.ipublikuj.eu | ||
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu> | ||
* @package iPublikuj:MQTTClient! | ||
* @subpackage Events | ||
* @since 1.0.0 | ||
* | ||
* @date 14.11.19 | ||
*/ | ||
|
||
namespace IPub\MQTTClient\Events; | ||
|
||
use Symfony\Contracts\EventDispatcher; | ||
|
||
use BinSoul\Net\Mqtt; | ||
|
||
use IPub\MQTTClient\Client; | ||
|
||
/** | ||
* Disconnected event | ||
* | ||
* @package iPublikuj:MQTTClient! | ||
* @subpackage Events | ||
* | ||
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu> | ||
*/ | ||
final class DisconnectEvent extends EventDispatcher\Event | ||
{ | ||
/** | ||
* @var Mqtt\Connection | ||
*/ | ||
private $connection; | ||
|
||
/** | ||
* @var Client\IClient | ||
*/ | ||
private $client; | ||
|
||
/** | ||
* @param Mqtt\Connection $connection | ||
* @param Client\IClient $client | ||
*/ | ||
public function __construct( | ||
Mqtt\Connection $connection, | ||
Client\IClient $client | ||
) { | ||
$this->connection = $connection; | ||
$this->client = $client; | ||
} | ||
|
||
/** | ||
* @return Mqtt\Connection | ||
*/ | ||
public function getConnection() : Mqtt\Connection | ||
{ | ||
return $this->connection; | ||
} | ||
|
||
/** | ||
* @return Client\IClient | ||
*/ | ||
public function getClient() : Client\IClient | ||
{ | ||
return $this->client; | ||
} | ||
} |
Oops, something went wrong.