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