PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
| Dir : /home/sc1buiq6159/smile.formagloba.fr/wp-content/plugins/site-reviews/plugin/ |
| Server: Linux apophis.o2switch.net 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64 IP: 109.234.164.184 |
| Dir : /home/sc1buiq6159/smile.formagloba.fr/wp-content/plugins/site-reviews/plugin/Storage.php |
<?php
namespace GeminiLabs\SiteReviews;
use GeminiLabs\SiteReviews\Helpers\Cast;
trait Storage
{
/** @var Arguments */
protected $storage;
/**
* @param mixed $value
*/
public function append(string $property, $value, ?string $key = null): bool
{
$stored = $this->retrieve($property, []);
if (!is_array($stored)) {
return false;
}
if ($key) {
$stored[$key] = $value;
} else {
$stored[] = $value;
}
$this->store($property, $stored);
return true;
}
public function discard(string $property): void
{
unset($this->storage()->$property);
}
/**
* @param mixed $fallback
*
* @return mixed
*/
public function retrieve(string $property, $fallback = null)
{
return $this->storage()->get($property, $fallback);
}
/**
* @param mixed $fallback
*
* @return mixed
*/
public function retrieveAs(string $cast, string $property, $fallback = null)
{
return Cast::to($cast, $this->storage()->get($property, $fallback));
}
public function storage(): Arguments
{
if (!$this->storage instanceof Arguments) {
$this->storage = new Arguments([]);
}
return $this->storage;
}
/**
* @param mixed $value
*/
public function store(string $property, $value): void
{
$this->storage()->set($property, $value);
}
}