mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code cleanup.
This commit is contained in:
@@ -25,7 +25,6 @@ namespace FireflyIII\Helpers\Webhook;
|
||||
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\WebhookMessage;
|
||||
use JsonException;
|
||||
|
||||
/**
|
||||
* Class Sha3SignatureGenerator
|
||||
@@ -35,7 +34,6 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface
|
||||
private int $version = 1;
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function generate(WebhookMessage $message): string
|
||||
@@ -48,11 +46,12 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface
|
||||
|
||||
try {
|
||||
$json = json_encode($message->message, JSON_THROW_ON_ERROR);
|
||||
} catch (JsonException $e) {
|
||||
} catch (\JsonException $e) {
|
||||
app('log')->error('Could not generate hash.');
|
||||
app('log')->error(sprintf('JSON value: %s', $json));
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
|
||||
throw new FireflyException('Could not generate JSON for SHA3 hash.', 0, $e);
|
||||
}
|
||||
|
||||
@@ -73,9 +72,6 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface
|
||||
return sprintf('t=%s,v%d=%s', $timestamp, $this->getVersion(), $signature);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getVersion(): int
|
||||
{
|
||||
return $this->version;
|
||||
|
Reference in New Issue
Block a user