HasSetSettings::setSettingBool()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
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
$this of type Bavix\Settings\Traits\HasSetSettings is incompatible with the type Bavix\Settings\Interfaces\Settingable expected by parameter $model of Bavix\Settings\Services\...ervice::setSettingInt(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

19
            ->setSettingInt(/** @scrutinizer ignore-type */ $this, $key, $value);
Loading history...
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
Bug introduced by
$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 ignore-type  annotation

30
            ->setSettingFloat(/** @scrutinizer ignore-type */ $this, $key, $value);
Loading history...
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
Bug introduced by
$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 ignore-type  annotation

41
            ->setSettingBool(/** @scrutinizer ignore-type */ $this, $key, $value);
Loading history...
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
Bug introduced by
$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 ignore-type  annotation

52
            ->setSettingString(/** @scrutinizer ignore-type */ $this, $key, $value);
Loading history...
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
Bug introduced by
$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 ignore-type  annotation

63
            ->setSettingArray(/** @scrutinizer ignore-type */ $this, $key, $value);
Loading history...
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
Bug introduced by
$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 ignore-type  annotation

75
            ->setSetting(/** @scrutinizer ignore-type */ $this, $key, $cast, $value);
Loading history...
76
    }
77
78
}
79