mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 00:27:30 +00:00
Code cleanup
This commit is contained in:
@@ -23,10 +23,13 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Support;
|
||||
|
||||
use Cache;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\Category;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Class CacheProperties.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class CacheProperties
|
||||
@@ -49,8 +52,8 @@ class CacheProperties
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $property
|
||||
* @param Collection|\Carbon\Carbon|\FireflyIII\Models\Category|array|int|string $property
|
||||
* @param $property
|
||||
* @param Collection|Carbon|Category|array|int|string $property
|
||||
*/
|
||||
public function addProperty($property): void
|
||||
{
|
||||
@@ -86,15 +89,6 @@ class CacheProperties
|
||||
return Cache::has($this->hash);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $data
|
||||
* @param (array|mixed)[]|Collection|\Carbon\Carbon|string $data
|
||||
*/
|
||||
public function store($data): void
|
||||
{
|
||||
Cache::forever($this->hash, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
private function hash(): void
|
||||
@@ -105,4 +99,13 @@ class CacheProperties
|
||||
}
|
||||
$this->hash = substr(hash('sha256', $content), 0, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $data
|
||||
* @param (array|mixed)[]|Collection|\Carbon\Carbon|string $data
|
||||
*/
|
||||
public function store($data): void
|
||||
{
|
||||
Cache::forever($this->hash, $data);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user