1 | <?php |
||||
2 | |||||
3 | namespace Bavix\Settings\Traits; |
||||
4 | |||||
5 | use Bavix\Settings\Models\Setting; |
||||
6 | use Bavix\Settings\Services\WritableService; |
||||
7 | |||||
8 | trait HasSetSettings |
||||
9 | { |
||||
10 | |||||
11 | /** |
||||
12 | * @param string $key |
||||
13 | * @param int|null $value |
||||
14 | * @return Setting |
||||
15 | */ |
||||
16 | 1 | public function setSettingInt(string $key, ?int $value = null): Setting |
|||
17 | { |
||||
18 | 1 | return app(WritableService::class) |
|||
19 | 1 | ->setSettingInt($this, $key, $value); |
|||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||
20 | } |
||||
21 | |||||
22 | /** |
||||
23 | * @param string $key |
||||
24 | * @param float|null $value |
||||
25 | * @return Setting |
||||
26 | */ |
||||
27 | 1 | public function setSettingFloat(string $key, ?float $value = null): Setting |
|||
28 | { |
||||
29 | 1 | return app(WritableService::class) |
|||
30 | 1 | ->setSettingFloat($this, $key, $value); |
|||
0 ignored issues
–
show
$this of type Bavix\Settings\Traits\HasSetSettings is incompatible with the type Bavix\Settings\Interfaces\Settingable expected by parameter $model of Bavix\Settings\Services\...vice::setSettingFloat() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
31 | } |
||||
32 | |||||
33 | /** |
||||
34 | * @param string $key |
||||
35 | * @param bool|null $value |
||||
36 | * @return Setting |
||||
37 | */ |
||||
38 | 1 | public function setSettingBool(string $key, ?bool $value = null): Setting |
|||
39 | { |
||||
40 | 1 | return app(WritableService::class) |
|||
41 | 1 | ->setSettingBool($this, $key, $value); |
|||
0 ignored issues
–
show
$this of type Bavix\Settings\Traits\HasSetSettings is incompatible with the type Bavix\Settings\Interfaces\Settingable expected by parameter $model of Bavix\Settings\Services\...rvice::setSettingBool() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
42 | } |
||||
43 | |||||
44 | /** |
||||
45 | * @param string $key |
||||
46 | * @param string|null $value |
||||
47 | * @return Setting |
||||
48 | */ |
||||
49 | 1 | public function setSettingString(string $key, ?string $value = null): Setting |
|||
50 | { |
||||
51 | 1 | return app(WritableService::class) |
|||
52 | 1 | ->setSettingString($this, $key, $value); |
|||
0 ignored issues
–
show
$this of type Bavix\Settings\Traits\HasSetSettings is incompatible with the type Bavix\Settings\Interfaces\Settingable expected by parameter $model of Bavix\Settings\Services\...ice::setSettingString() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
53 | } |
||||
54 | |||||
55 | /** |
||||
56 | * @param string $key |
||||
57 | * @param array|null $value |
||||
58 | * @return Setting |
||||
59 | */ |
||||
60 | 1 | public function setSettingArray(string $key, ?array $value = null): Setting |
|||
61 | { |
||||
62 | 1 | return app(WritableService::class) |
|||
63 | 1 | ->setSettingArray($this, $key, $value); |
|||
0 ignored issues
–
show
$this of type Bavix\Settings\Traits\HasSetSettings is incompatible with the type Bavix\Settings\Interfaces\Settingable expected by parameter $model of Bavix\Settings\Services\...vice::setSettingArray() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
64 | } |
||||
65 | |||||
66 | /** |
||||
67 | * @param string $key |
||||
68 | * @param string $cast |
||||
69 | * @param mixed $value |
||||
70 | * @return Setting |
||||
71 | */ |
||||
72 | 2 | public function setSetting(string $key, string $cast, $value): Setting |
|||
73 | { |
||||
74 | 2 | return app(WritableService::class) |
|||
75 | 2 | ->setSetting($this, $key, $cast, $value); |
|||
0 ignored issues
–
show
$this of type Bavix\Settings\Traits\HasSetSettings is incompatible with the type Bavix\Settings\Interfaces\Settingable expected by parameter $model of Bavix\Settings\Services\...leService::setSetting() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
76 | } |
||||
77 | |||||
78 | } |
||||
79 |