diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d473bd0..9fc25ba 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: [7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3] + php-version: [7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4] protocol: [ 'json', 'msgpack' ] ignorePlatformReq: [ '' ] diff --git a/src/Models/BaseMessage.php b/src/Models/BaseMessage.php index 626013a..8cbfebe 100644 --- a/src/Models/BaseMessage.php +++ b/src/Models/BaseMessage.php @@ -114,7 +114,7 @@ public function fromJSON( $json, $keepOriginal = false ) { * @param stdClass $obj Message-like object * @param CipherParams|null $cipherParams */ - public static function fromEncoded( $obj, CipherParams $cipherParams = null ) { + public static function fromEncoded( $obj, ?CipherParams $cipherParams = null ) { $class = get_called_class(); $msg = new $class(); @@ -138,7 +138,7 @@ public static function fromEncoded( $obj, CipherParams $cipherParams = null ) { * @param array $objs Array of Message-Like objects * @param CipherParams|null $cipherParams */ - public static function fromEncodedArray( $objs, CipherParams $cipherParams = null ) { + public static function fromEncodedArray( $objs, ?CipherParams $cipherParams = null ) { return array_map( function( $obj ) use ($cipherParams) { return static::fromEncoded($obj, $cipherParams); }, $objs diff --git a/tests/ChannelMessagesTest.php b/tests/ChannelMessagesTest.php index 6a3f9c6..4f4f9c6 100644 --- a/tests/ChannelMessagesTest.php +++ b/tests/ChannelMessagesTest.php @@ -541,7 +541,9 @@ public function testEncodingInteroperabilityAblyToRaw() { $msg = $history[$i]; $this->assertEquals($testMsgData->data, $msg->data); - $this->assertEquals($testMsgData->encoding, $msg->encoding); + if (property_exists($msg, 'encoding')) { + $this->assertEquals($testMsgData->encoding, $msg->encoding); + } } }