Add return types and docblock

This commit is contained in:
Marcus Moore 2023-04-06 17:58:53 -07:00
parent 95f195046d
commit 9561b66613
No known key found for this signature in database

View file

@ -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;