Skip to content

Commit 616f842

Browse files
authored
Use spaze/encryption v2.0 (#12)
The API is the same, only the class name changes, I mean there's more changes but the only relevant here is the class name change. https://github.com/spaze/encryption/releases/tag/v2.0.0
2 parents feb2975 + 0dce949 commit 616f842

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"phpstan/phpstan": "^1.9",
2727
"phpstan/phpstan-nette": "^1.0",
2828
"spaze/coding-standard": "^1.3",
29-
"spaze/encryption": "^1.0"
29+
"spaze/encryption": "^2.0"
3030
},
3131
"scripts": {
3232
"lint": "vendor/bin/parallel-lint --colors src/",

src/DI/MysqlSessionHandlerExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Nette\DI\Definitions\Statement;
99
use Nette\Schema\Expect;
1010
use Nette\Schema\Schema;
11-
use Spaze\Encryption\Symmetric\StaticKey;
11+
use Spaze\Encryption\SymmetricKeyEncryption;
1212
use stdClass;
1313

1414
/**
@@ -23,7 +23,7 @@ public function getConfigSchema(): Schema
2323
'tableName' => Expect::string()->default('sessions'),
2424
'lockTimeout' => Expect::int()->default(5),
2525
'unchangedUpdateDelay' => Expect::int()->default(300),
26-
'encryptionService' => Expect::string(StaticKey::class),
26+
'encryptionService' => Expect::string(SymmetricKeyEncryption::class),
2727
]);
2828
}
2929

src/MysqlSessionHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Nette\Database\Table\ActiveRow;
88
use Nette\SmartObject;
99
use SessionHandlerInterface;
10-
use Spaze\Encryption\Symmetric\StaticKey as StaticKeyEncryption;
10+
use Spaze\Encryption\SymmetricKeyEncryption;
1111

1212
/**
1313
* Storing session to database.
@@ -21,7 +21,7 @@ class MysqlSessionHandler implements SessionHandlerInterface
2121
use SmartObject;
2222

2323

24-
private ?StaticKeyEncryption $encryptionService = null;
24+
private ?SymmetricKeyEncryption $encryptionService = null;
2525

2626
private string $tableName;
2727

@@ -75,7 +75,7 @@ public function setUnchangedUpdateDelay(int $delay): void
7575
}
7676

7777

78-
public function setEncryptionService(StaticKeyEncryption $encryptionService): void
78+
public function setEncryptionService(SymmetricKeyEncryption $encryptionService): void
7979
{
8080
$this->encryptionService = $encryptionService;
8181
}

0 commit comments

Comments
 (0)