Various code cleanup.

This commit is contained in:
James Cole
2025-10-05 12:57:58 +02:00
parent 072212c112
commit 6341743cf9
169 changed files with 482 additions and 305 deletions

View File

@@ -37,6 +37,7 @@ use Illuminate\Support\Facades\Storage;
use Illuminate\Support\MessageBag;
use Safe\Exceptions\FileinfoException;
use Safe\Exceptions\FilesystemException;
use Safe\Exceptions\StringsException;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use function Safe\tmpfile;
@@ -222,8 +223,11 @@ class AttachmentHelper implements AttachmentHelperInterface
/**
* Process the upload of a file.
*
* @throws FireflyException
* @throws EncryptException
* @param UploadedFile $file
* @param Model $model
*
* @return Attachment|null
* @throws StringsException
*/
protected function processFile(UploadedFile $file, Model $model): ?Attachment
{

View File

@@ -43,7 +43,6 @@ trait AccountCollection
Log::warning(sprintf('GroupCollector will be SLOW: accountBalanceIs: "%s" "%s" "%s"', $direction, $operator, $value));
/**
* @param int $index
* @param array $object
*
* @return bool

View File

@@ -41,7 +41,6 @@ trait AttachmentCollection
$this->withAttachmentInformation();
/**
* @param int $index
* @param array $object
*
* @return bool
@@ -120,7 +119,6 @@ trait AttachmentCollection
$this->withAttachmentInformation();
/**
* @param int $index
* @param array $object
*
* @return bool
@@ -155,7 +153,6 @@ trait AttachmentCollection
$this->withAttachmentInformation();
/**
* @param int $index
* @param array $object
*
* @return bool
@@ -190,7 +187,6 @@ trait AttachmentCollection
$this->withAttachmentInformation();
/**
* @param int $index
* @param array $object
*
* @return bool

View File

@@ -48,6 +48,7 @@ use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Override;
use Safe\Exceptions\JsonException;
use function Safe\json_decode;
/**
@@ -564,7 +565,11 @@ class GroupCollector implements GroupCollectorInterface
}
/**
* @param TransactionJournal $augumentedJournal
*
* @return array
* @throws FireflyException
* @throws JsonException
*/
private function parseAugmentedJournal(TransactionJournal $augumentedJournal): array
{

View File

@@ -24,6 +24,8 @@ declare(strict_types=1);
namespace FireflyIII\Helpers\Fiscal;
use Carbon\Carbon;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/**
* Class FiscalHelper.
@@ -62,7 +64,11 @@ class FiscalHelper implements FiscalHelperInterface
}
/**
* @param Carbon $date
*
* @return Carbon date object
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function startOfFiscalYear(Carbon $date): Carbon
{

View File

@@ -68,7 +68,7 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface
// The actual JSON payload (i.e., the request body)
$timestamp = Carbon::now()->getTimestamp();
$payload = sprintf('%s.%s', $timestamp, $json);
$signature = hash_hmac('sha3-256', $payload, (string) $message->webhook->secret, false);
$signature = hash_hmac('sha3-256', $payload, (string) $message->webhook->secret);
// signature string:
// header included in each signed event contains a timestamp and one or more signatures.