v1.5.0
What's Changed
Fixed
Changed
- Pass matched topic wildcards to subscription callback by @Namoshek in #128
- Bump sonarsource/sonarcloud-github-action from 1.6 to 1.7 by @dependabot in #125
Full Changelog: v1.4.0...v1.5.0
Explanation for #128:
The matched wildcards are now passed as fourth parameter to the subscription callback:
$mqtt->subscribe('foo/+/bar/#', function ($topic, $message, $retained, $matchedWildcards) {
echo sprintf("Received message on topic [%s]: %s\n", $topic, $message);
echo sprintf("Matched wildcards: %s\n", json_encode($matchedWildcards));
}, 0);
// Received message on topic [foo/baz/bar/hello/world/42]: hello world!
// Matched wildcards: ["baz", "hello/world/42"]