Skip to content

Commit cec67fc

Browse files
committed
Vendor patched React MQTT Client classes
See binsoul/net-mqtt-client-react#17 and binsoul/net-mqtt#8 for clarification.
1 parent 559df45 commit cec67fc

File tree

7 files changed

+858
-11
lines changed

7 files changed

+858
-11
lines changed

.php_cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ return \PhpCsFixer\Config::create()
77
'src',
88
'tests',
99
])
10+
->exclude([
11+
'React',
12+
])
1013
)
1114
->setRules([
1215
'@Symfony' => true,

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030
},
3131
"require": {
32-
"php": "^7.4",
32+
"php": "^7.2",
3333
"ext-json": "*",
3434
"ext-mbstring": "*",
3535
"ext-zlib": "*",

src/Lite/FlowFactory.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
use BinSoul\Net\Mqtt\ClientIdentifierGenerator;
88
use BinSoul\Net\Mqtt\Connection;
99
use BinSoul\Net\Mqtt\Flow;
10-
use BinSoul\Net\Mqtt\FlowFactory as FlowFactoryInterface;
1110
use BinSoul\Net\Mqtt\Message;
1211
use BinSoul\Net\Mqtt\PacketFactory;
1312
use BinSoul\Net\Mqtt\PacketIdentifierGenerator;
13+
use Fbns\React\FlowFactory as FlowFactoryInterface;
1414

1515
class FlowFactory implements FlowFactoryInterface
1616
{
@@ -37,42 +37,42 @@ public function __construct(
3737
$this->packetFactory = $packetFactory;
3838
}
3939

40-
public function buildIncomingPingFlow(): Flow\IncomingPingFlow
40+
public function buildIncomingPingFlow(): Flow
4141
{
4242
return new Flow\IncomingPingFlow($this->packetFactory);
4343
}
4444

45-
public function buildIncomingPublishFlow(Message $message, int $identifier = null): Flow\IncomingPublishFlow
45+
public function buildIncomingPublishFlow(Message $message, int $identifier = null): Flow
4646
{
4747
return new Flow\IncomingPublishFlow($this->packetFactory, $message, $identifier);
4848
}
4949

50-
public function buildOutgoingConnectFlow(Connection $connection): OutgoingConnectFlow
50+
public function buildOutgoingConnectFlow(Connection $connection): Flow
5151
{
5252
return new OutgoingConnectFlow($this->packetFactory, $connection, $this->clientIdentifierGenerator);
5353
}
5454

55-
public function buildOutgoingDisconnectFlow(Connection $connection): Flow\OutgoingDisconnectFlow
55+
public function buildOutgoingDisconnectFlow(Connection $connection): Flow
5656
{
5757
return new Flow\OutgoingDisconnectFlow($this->packetFactory, $connection);
5858
}
5959

60-
public function buildOutgoingPingFlow(): Flow\OutgoingPingFlow
60+
public function buildOutgoingPingFlow(): Flow
6161
{
6262
return new Flow\OutgoingPingFlow($this->packetFactory);
6363
}
6464

65-
public function buildOutgoingPublishFlow(Message $message): Flow\OutgoingPublishFlow
65+
public function buildOutgoingPublishFlow(Message $message): Flow
6666
{
6767
return new Flow\OutgoingPublishFlow($this->packetFactory, $message, $this->packetIdentifierGenerator);
6868
}
6969

70-
public function buildOutgoingSubscribeFlow(array $subscriptions): Flow\OutgoingSubscribeFlow
70+
public function buildOutgoingSubscribeFlow(array $subscriptions): Flow
7171
{
7272
return new Flow\OutgoingSubscribeFlow($this->packetFactory, $subscriptions, $this->packetIdentifierGenerator);
7373
}
7474

75-
public function buildOutgoingUnsubscribeFlow(array $subscriptions): Flow\OutgoingUnsubscribeFlow
75+
public function buildOutgoingUnsubscribeFlow(array $subscriptions): Flow
7676
{
7777
return new Flow\OutgoingUnsubscribeFlow($this->packetFactory, $subscriptions, $this->packetIdentifierGenerator);
7878
}

src/Mqtt/RtiClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Fbns\Mqtt;
66

7-
use BinSoul\Net\Mqtt\Client\React\ReactMqttClient;
87
use BinSoul\Net\Mqtt\DefaultMessage;
98
use BinSoul\Net\Mqtt\Message;
109
use BinSoul\Net\Mqtt\StreamParser;
@@ -14,6 +13,7 @@
1413
use Fbns\Lite\ConnectResponsePacket;
1514
use Fbns\Lite\FlowFactory;
1615
use Fbns\Lite\PacketFactory;
16+
use Fbns\React\ReactMqttClient;
1717
use Psr\Log\LoggerInterface;
1818
use React\EventLoop\LoopInterface;
1919
use React\EventLoop\TimerInterface;

src/React/FlowFactory.php

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Fbns\React;
6+
7+
use BinSoul\Net\Mqtt\Connection;
8+
use BinSoul\Net\Mqtt\Flow;
9+
use BinSoul\Net\Mqtt\Message;
10+
use BinSoul\Net\Mqtt\Subscription;
11+
12+
/**
13+
* Builds instances of the {@see Flow} interface.
14+
*/
15+
interface FlowFactory
16+
{
17+
/**
18+
* @return Flow
19+
*/
20+
public function buildIncomingPingFlow(): Flow;
21+
22+
/**
23+
* @param Message $message
24+
* @param int|null $identifier
25+
*
26+
* @return Flow
27+
*/
28+
public function buildIncomingPublishFlow(Message $message, int $identifier = null): Flow;
29+
30+
/**
31+
* @param Connection $connection
32+
*
33+
* @return Flow
34+
*/
35+
public function buildOutgoingConnectFlow(Connection $connection): Flow;
36+
37+
/**
38+
* @param Connection $connection
39+
*
40+
* @return Flow
41+
*/
42+
public function buildOutgoingDisconnectFlow(Connection $connection): Flow;
43+
44+
/**
45+
* @return Flow
46+
*/
47+
public function buildOutgoingPingFlow(): Flow;
48+
49+
/**
50+
* @param Message $message
51+
*
52+
* @return Flow
53+
*/
54+
public function buildOutgoingPublishFlow(Message $message): Flow;
55+
56+
/**
57+
* @param Subscription[] $subscriptions
58+
*
59+
* @return Flow
60+
*/
61+
public function buildOutgoingSubscribeFlow(array $subscriptions): Flow;
62+
63+
/**
64+
* @param Subscription[] $subscriptions
65+
*
66+
* @return Flow
67+
*/
68+
public function buildOutgoingUnsubscribeFlow(array $subscriptions): Flow;
69+
}

src/React/LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The MIT License (MIT)
2+
3+
Copyright (c) 2015 Sebastian Mößler <[email protected]>
4+
5+
> Permission is hereby granted, free of charge, to any person obtaining a copy
6+
> of this software and associated documentation files (the "Software"), to deal
7+
> in the Software without restriction, including without limitation the rights
8+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
> copies of the Software, and to permit persons to whom the Software is
10+
> furnished to do so, subject to the following conditions:
11+
>
12+
> The above copyright notice and this permission notice shall be included in
13+
> all copies or substantial portions of the Software.
14+
>
15+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
> THE SOFTWARE.

0 commit comments

Comments
 (0)