Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
seba-aln committed Oct 3, 2023
1 parent 59d8462 commit b1aa5d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/PubNub/CryptoModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function registerCryptor(Cryptor $cryptor, ?string $cryptorId = null): se
return $this;
}

protected function stringify(mixed $data): string
protected function stringify($data): string
{
if (is_string($data)) {
return $data;
Expand All @@ -57,7 +57,7 @@ protected function stringify(mixed $data): string
}
}

public function encrypt(mixed $data, ?string $cryptorId = null): string
public function encrypt($data, ?string $cryptorId = null): string
{
if (($data) == '') {
throw new PubNubResponseParsingException("Encryption error: message is empty");
Expand Down
5 changes: 4 additions & 1 deletion src/PubNub/PNConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class PNConfiguration

private $usingUserId = null;

private string $cipherKey;

/**
* PNConfiguration constructor.
*/
Expand Down Expand Up @@ -122,7 +124,7 @@ public function setSecretKey($secretKey)
*/
public function getCipherKey()
{
return $this->getCrypto()->getCipherKey();
return $this->cipherKey;
}

public function isAesEnabled()
Expand All @@ -136,6 +138,7 @@ public function isAesEnabled()
*/
public function setCipherKey($cipherKey)
{
$this->cipherKey = $cipherKey;
if ($this->crypto == null) {
$this->crypto = CryptoModule::legacyCryptor($cipherKey, $this->getUseRandomIV());
} else {
Expand Down

0 comments on commit b1aa5d9

Please sign in to comment.