Skip to content

Commit

Permalink
Update CryptProvider.php
Browse files Browse the repository at this point in the history
  • Loading branch information
shenyman authored Jan 28, 2023
1 parent 73371ec commit ff0615c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/Providers/CryptProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Vokuro\Providers;

use Phalcon\Crypt;
use Phalcon\Encryption\Crypt;
use Phalcon\Di\DiInterface;
use Phalcon\Di\ServiceProviderInterface;

Expand All @@ -31,13 +31,17 @@ class CryptProvider implements ServiceProviderInterface
public function register(DiInterface $di): void
{
/** @var string $cryptSalt */
$cryptSalt = $di->getShared('config')->path('application.cryptSalt');
$cryptSalt = $di->getShared('config')
->path('application.cryptSalt');

$di->set($this->providerName, function () use ($cryptSalt) {
$crypt = new Crypt();
$crypt->setKey($cryptSalt);
$di->set(
$this->providerName,
function () use ($cryptSalt) {
$crypt = new Crypt();
$crypt->setKey($cryptSalt);

return $crypt;
});
return $crypt;
}
);
}
}

0 comments on commit ff0615c

Please sign in to comment.