Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ body:
label: Optional packet capture logs
description: |
You can also provide tcpdump packet capture logs.
Example command: `tcpdump -i en0 port 1883 -w mqtt.pcap`
Example command: `tcpdump -i eth0 port 1883 -w mqtt.pcap`
Please change the network card and port to match your environment, then attach `mqtt.pcap`.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/support-question.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ body:
attributes:
label: Context
description: Add relevant code snippets, logs, or environment details.

4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
php-version: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
swoole-version: [ 'v4.8.13', 'v5.1.8', 'v6.2.0', 'master' ]
swoole-version: [ 'v4.8.13', 'v5.1.8', 'v6.2.1', 'master' ]
exclude:
- php-version: '8.5'
swoole-version: 'v5.1.8'
Expand All @@ -36,7 +36,7 @@ jobs:
- php-version: '8.3'
swoole-version: 'v4.8.13'
- php-version: '8.1'
swoole-version: 'v6.2.0'
swoole-version: 'v6.2.1'
- php-version: '8.1'
swoole-version: 'master'
max-parallel: 10
Expand Down
10 changes: 3 additions & 7 deletions src/BaseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,11 @@ public function setConnectData(array $connectData): self
*/
public function getConnectData(?string $key = null)
{
if ($key) {
if (isset($this->connectData[$key])) {
return $this->connectData[$key];
}

return null;
if ($key === null) {
return $this->connectData;
}

return $this->connectData;
return $this->connectData[$key] ?? null;
}

protected function isCoroutineClientType(): bool
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testConnectException()
public function testBase64()
{
$topic = 'simps-mqtt/test/base64';
$base64 = base64_encode(file_get_contents(TESTS_DIR . '/files/wechat.jpg'));
$base64 = base64_encode(file_get_contents(TESTS_DIR . '/files/wechat.png'));
$client = new MQTTClient(SIMPS_MQTT_REMOTE_HOST, SIMPS_MQTT_PORT, getTestConnectConfig());
$client->connect(false);
$client->subscribe([$topic => 0]);
Expand Down
Binary file removed tests/files/wechat.jpg
Binary file not shown.
Binary file added tests/files/wechat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading