Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update to require minimum PHP 8 #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Namoshek merged 4 commits into master from feature/require-php-8
Nov 25, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:

strategy:
matrix:
php-version: ['7.4', '8.0', '8.1']
php-version: ['8.0', '8.1', '8.2', '8.3']
mqtt-broker: ['mosquitto-1.6', 'mosquitto-2.0', 'hivemq', 'emqx', 'rabbitmq']
include:
- php-version: '8.1'
- php-version: '8.3'
mqtt-broker: 'mosquitto-2.0'
run-sonarqube-analysis: true

Expand Down
2 changes: 1 addition & 1 deletion composer.json
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
},
"require": {
"php": "^7.4|^8.0",
"php": "^8.0",
"psr/log": "^1.1|^2.0|^3.0",
"myclabs/php-enum": "^1.7"
},
Expand Down
2 changes: 0 additions & 2 deletions src/Concerns/GeneratesRandomClientIds.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ trait GeneratesRandomClientIds
{
/**
* Generates a random client id in the form of an md5 hash.
*
* @return string
*/
protected function generateRandomClientId(): string
{
Expand Down
45 changes: 0 additions & 45 deletions src/Concerns/OffersHooks.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ trait OffersHooks

/**
* Needs to be called in order to initialize the trait.
*
* @return void
*/
protected function initializeEventHandlers(): void
{
Expand Down Expand Up @@ -59,9 +57,6 @@ protected function initializeEventHandlers(): void
* ```
*
* Multiple event handlers can be registered at the same time.
*
* @param \Closure $callback
* @return MqttClient
*/
public function registerLoopEventHandler(\Closure $callback): MqttClient
{
Expand All @@ -77,9 +72,6 @@ public function registerLoopEventHandler(\Closure $callback): MqttClient
*
* This does not affect other registered event handlers. It is possible
* to unregister all registered event handlers by passing null as callback.
*
* @param \Closure|null $callback
* @return MqttClient
*/
public function unregisterLoopEventHandler(\Closure $callback = null): MqttClient
{
Expand All @@ -96,9 +88,6 @@ public function unregisterLoopEventHandler(\Closure $callback = null): MqttClien
/**
* Runs all registered loop event handlers with the given parameters.
* Each event handler is executed in a try-catch block to avoid spilling exceptions.
*
* @param float $elapsedTime
* @return void
*/
private function runLoopEventHandlers(float $elapsedTime): void
{
Expand Down Expand Up @@ -134,9 +123,6 @@ private function runLoopEventHandlers(float $elapsedTime): void
* ```
*
* Multiple event handlers can be registered at the same time.
*
* @param \Closure $callback
* @return MqttClient
*/
public function registerPublishEventHandler(\Closure $callback): MqttClient
{
Expand All @@ -152,9 +138,6 @@ public function registerPublishEventHandler(\Closure $callback): MqttClient
*
* This does not affect other registered event handlers. It is possible
* to unregister all registered event handlers by passing null as callback.
*
* @param \Closure|null $callback
* @return MqttClient
*/
public function unregisterPublishEventHandler(\Closure $callback = null): MqttClient
{
Expand All @@ -171,13 +154,6 @@ public function unregisterPublishEventHandler(\Closure $callback = null): MqttCl
/**
* Runs all the registered publish event handlers with the given parameters.
* Each event handler is executed in a try-catch block to avoid spilling exceptions.
*
* @param string $topic
* @param string $message
* @param int|null $messageId
* @param int $qualityOfService
* @param bool $retain
* @return void
*/
private function runPublishEventHandlers(string $topic, string $message, ?int $messageId, int $qualityOfService, bool $retain): void
{
Expand Down Expand Up @@ -214,9 +190,6 @@ private function runPublishEventHandlers(string $topic, string $message, ?int $m
* ```
*
* Multiple event handlers can be registered at the same time.
*
* @param \Closure $callback
* @return MqttClient
*/
public function registerMessageReceivedEventHandler(\Closure $callback): MqttClient
{
Expand All @@ -231,9 +204,6 @@ public function registerMessageReceivedEventHandler(\Closure $callback): MqttCli
*
* This does not affect other registered event handlers. It is possible
* to unregister all registered event handlers by passing null as callback.
*
* @param \Closure|null $callback
* @return MqttClient
*/
public function unregisterMessageReceivedEventHandler(\Closure $callback = null): MqttClient
{
Expand All @@ -250,12 +220,6 @@ public function unregisterMessageReceivedEventHandler(\Closure $callback = null)
/**
* Runs all the registered message received event handlers with the given parameters.
* Each event handler is executed in a try-catch block to avoid spilling exceptions.
*
* @param string $topic
* @param string $message
* @param int $qualityOfService
* @param bool $retained
* @return void
*/
private function runMessageReceivedEventHandlers(string $topic, string $message, int $qualityOfService, bool $retained): void
{
Expand Down Expand Up @@ -293,9 +257,6 @@ private function runMessageReceivedEventHandlers(string $topic, string $message,
* ```
*
* Multiple event handlers can be registered at the same time.
*
* @param \Closure $callback
* @return MqttClient
*/
public function registerConnectedEventHandler(\Closure $callback): MqttClient
{
Expand All @@ -310,9 +271,6 @@ public function registerConnectedEventHandler(\Closure $callback): MqttClient
*
* This does not affect other registered event handlers. It is possible
* to unregister all registered event handlers by passing null as callback.
*
* @param \Closure|null $callback
* @return MqttClient
*/
public function unregisterConnectedEventHandler(\Closure $callback = null): MqttClient
{
Expand All @@ -329,9 +287,6 @@ public function unregisterConnectedEventHandler(\Closure $callback = null): Mqtt
/**
* Runs all the registered connected event handlers.
* Each event handler is executed in a try-catch block to avoid spilling exceptions.
*
* @param bool $isAutoReconnect
* @return void
*/
private function runConnectedEventHandlers(bool $isAutoReconnect): void
{
Expand Down
12 changes: 0 additions & 12 deletions src/Concerns/TranscodesData.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ trait TranscodesData
* \x00\x0bhello world
*
* where \x000円x0b is the hex representation of 00000000 00001011 = 11
*
* @param string $data
* @return string
*/
protected function buildLengthPrefixedString(string $data): string
{
Expand All @@ -35,9 +32,6 @@ protected function buildLengthPrefixedString(string $data): string
/**
* Converts the given string to a number, assuming it is an MSB encoded message id.
* MSB means preceding characters have higher value.
*
* @param string $encodedMessageId
* @return int
*/
protected function decodeMessageId(string $encodedMessageId): int
{
Expand All @@ -53,9 +47,6 @@ protected function decodeMessageId(string $encodedMessageId): int

/**
* Encodes the given message identifier as string.
*
* @param int $messageId
* @return string
*/
protected function encodeMessageId(int $messageId): string
{
Expand All @@ -65,9 +56,6 @@ protected function encodeMessageId(int $messageId): string
/**
* Encodes the length of a message as string, so it can be transmitted
* over the wire.
*
* @param int $length
* @return string
*/
protected function encodeMessageLength(int $length): string
{
Expand Down
2 changes: 0 additions & 2 deletions src/Concerns/ValidatesConfiguration.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ trait ValidatesConfiguration
* which means they are misconfigured, an exception containing information about
* the configuration error is thrown.
*
* @param ConnectionSettings $settings
* @return void
* @throws ConfigurationInvalidException
*/
protected function ensureConnectionSettingsAreValid(ConnectionSettings $settings): void
Expand Down
4 changes: 0 additions & 4 deletions src/Concerns/WorksWithBuffers.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ trait WorksWithBuffers
{
/**
* Pops the first $limit bytes from the given buffer and returns them.
*
* @param string $buffer
* @param int $limit
* @return string
*/
protected function pop(string &$buffer, int $limit): string
{
Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /