Code cleanup.

This commit is contained in:
James Cole
2023-12-20 19:35:52 +01:00
parent c4f6366642
commit 64ec0cf62e
997 changed files with 12908 additions and 28136 deletions

View File

@@ -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;