Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Commit

Permalink
phpstan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacastelnuovo committed May 26, 2024
1 parent 94851a9 commit f1805ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ parameters:
level: 9
paths:
- src
- config
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
1 change: 0 additions & 1 deletion src/Age.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public function __construct(private ?PrivateKey $privateKey = null, private ?Pub
{
/* If no keys are provided, use the one from .env or create a pair. */
if (! isset($privateKey) && ! isset($publicKey)) {
/** @phpstan-ignore-next-line */
$this->privateKey = PrivateKey::generate();
$this->publicKey = $this->privateKey->getPublicKey();
}
Expand Down
4 changes: 4 additions & 0 deletions src/PrivateKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public function decrypt(string $message, bool $base64): string
$dir = TemporaryDirectory::make()->deleteWhenDestroyed();

$data = $base64 ? base64_decode($message, strict: true) : $message;
if (! $data) {
throw new Exception('Invalid message provided!');
}

Storage::build(['driver' => 'local', 'root' => $dir->path()])->put($ulid, $data);

/**
Expand Down

0 comments on commit f1805ae

Please sign in to comment.