Fix various code.

This commit is contained in:
James Cole
2025-05-27 17:06:15 +02:00
parent d8f512ca3a
commit 2cb14f6b72
123 changed files with 581 additions and 500 deletions

View File

@@ -23,10 +23,13 @@ declare(strict_types=1);
namespace FireflyIII\Support;
use Carbon\Carbon;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Cache;
use JsonException;
use function Safe\json_encode;
/**
* Class CacheProperties.
*/
@@ -80,10 +83,10 @@ class CacheProperties
$content = '';
foreach ($this->properties as $property) {
try {
$content = sprintf('%s%s', $content, \Safe\json_encode($property, JSON_THROW_ON_ERROR));
$content = sprintf('%s%s', $content, json_encode($property, JSON_THROW_ON_ERROR));
} catch (JsonException) {
// @ignoreException
$content = sprintf('%s%s', $content, hash('sha256', (string) time()));
$content = sprintf('%s%s', $content, hash('sha256', (string) Carbon::now()->getTimestamp()));
}
}
$this->hash = substr(hash('sha256', $content), 0, 16);