Clean up balance methods.

This commit is contained in:
James Cole
2024-12-22 20:32:58 +01:00
parent a0e92b6969
commit d90ac519f7
93 changed files with 1233 additions and 1853 deletions

View File

@@ -23,7 +23,9 @@ declare(strict_types=1);
namespace FireflyIII\Support;
use Cache;
use Illuminate\Support\Collection;
use JsonException;
/**
* Class CacheProperties.
@@ -55,7 +57,7 @@ class CacheProperties
*/
public function get()
{
return \Cache::get($this->hash);
return Cache::get($this->hash);
}
public function getHash(): string
@@ -70,16 +72,16 @@ class CacheProperties
}
$this->hash();
return \Cache::has($this->hash);
return Cache::has($this->hash);
}
private function hash(): void
{
$content = '';
$content = '';
foreach ($this->properties as $property) {
try {
$content .= json_encode($property, JSON_THROW_ON_ERROR);
} catch (\JsonException $e) {
} catch (JsonException $e) {
// @ignoreException
$content .= hash('sha256', (string) time());
}
@@ -92,6 +94,6 @@ class CacheProperties
*/
public function store($data): void
{
\Cache::forever($this->hash, $data);
Cache::forever($this->hash, $data);
}
}