Add return types and docblock
This commit is contained in:
parent
95f195046d
commit
9561b66613
1 changed files with 8 additions and 5 deletions
|
@ -7,28 +7,31 @@ use App\Models\Setting;
|
||||||
class Settings
|
class Settings
|
||||||
{
|
{
|
||||||
private Setting $setting;
|
private Setting $setting;
|
||||||
|
|
||||||
private function __construct()
|
private function __construct()
|
||||||
{
|
{
|
||||||
$this->setting = Setting::factory()->create();
|
$this->setting = Setting::factory()->create();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function initialize()
|
public static function initialize(): Settings
|
||||||
{
|
{
|
||||||
return new self();
|
return new self();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function enableMultipleFullCompanySupport()
|
public function enableMultipleFullCompanySupport(): void
|
||||||
{
|
{
|
||||||
$this->update(['full_multiple_companies_support' => 1]);
|
$this->update(['full_multiple_companies_support' => 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function set(array $attributes)
|
/**
|
||||||
|
* @param array $attributes Attributes to modify in the application's settings.
|
||||||
|
*/
|
||||||
|
public function set(array $attributes): void
|
||||||
{
|
{
|
||||||
$this->update($attributes);
|
$this->update($attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function update(array $attributes)
|
private function update(array $attributes): void
|
||||||
{
|
{
|
||||||
Setting::unguarded(fn() => $this->setting->update($attributes));
|
Setting::unguarded(fn() => $this->setting->update($attributes));
|
||||||
Setting::$_cache = null;
|
Setting::$_cache = null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue