Skip to content

Commit

Permalink
Use spaze/encryption v2.0, the API is the same, only the class name c…
Browse files Browse the repository at this point in the history
…hanges
  • Loading branch information
spaze committed Jan 19, 2024
1 parent feb2975 commit 0dce949
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"phpstan/phpstan": "^1.9",
"phpstan/phpstan-nette": "^1.0",
"spaze/coding-standard": "^1.3",
"spaze/encryption": "^1.0"
"spaze/encryption": "^2.0"
},
"scripts": {
"lint": "vendor/bin/parallel-lint --colors src/",
Expand Down
4 changes: 2 additions & 2 deletions src/DI/MysqlSessionHandlerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Nette\DI\Definitions\Statement;
use Nette\Schema\Expect;
use Nette\Schema\Schema;
use Spaze\Encryption\Symmetric\StaticKey;
use Spaze\Encryption\SymmetricKeyEncryption;
use stdClass;

/**
Expand All @@ -23,7 +23,7 @@ public function getConfigSchema(): Schema
'tableName' => Expect::string()->default('sessions'),
'lockTimeout' => Expect::int()->default(5),
'unchangedUpdateDelay' => Expect::int()->default(300),
'encryptionService' => Expect::string(StaticKey::class),
'encryptionService' => Expect::string(SymmetricKeyEncryption::class),
]);
}

Expand Down
6 changes: 3 additions & 3 deletions src/MysqlSessionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Nette\Database\Table\ActiveRow;
use Nette\SmartObject;
use SessionHandlerInterface;
use Spaze\Encryption\Symmetric\StaticKey as StaticKeyEncryption;
use Spaze\Encryption\SymmetricKeyEncryption;

/**
* Storing session to database.
Expand All @@ -21,7 +21,7 @@ class MysqlSessionHandler implements SessionHandlerInterface
use SmartObject;


private ?StaticKeyEncryption $encryptionService = null;
private ?SymmetricKeyEncryption $encryptionService = null;

private string $tableName;

Expand Down Expand Up @@ -75,7 +75,7 @@ public function setUnchangedUpdateDelay(int $delay): void
}


public function setEncryptionService(StaticKeyEncryption $encryptionService): void
public function setEncryptionService(SymmetricKeyEncryption $encryptionService): void
{
$this->encryptionService = $encryptionService;
}
Expand Down

0 comments on commit 0dce949

Please sign in to comment.