Skip to content

Commit 0c5fc24

Browse files
authored
Fix nullable type parameter deprecation warnings on PHP 8.4 (#128)
* fix: nullable type parameter deprecation on PHP 8.4
1 parent 599c711 commit 0c5fc24

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Contracts/SettingsManagerContract.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function apply(array $settings = []): self;
2323
* @param mixed $default default value to return if the path does not exist
2424
* @return mixed
2525
*/
26-
public function get(string $path = null, $default = null);
26+
public function get(?string $path = null, $default = null);
2727

2828
/**
2929
* Obtains multiple items by their paths.
@@ -55,7 +55,7 @@ public function update(string $path, $value): self;
5555
* @param string|null $path
5656
* @return \Glorand\Model\Settings\Contracts\SettingsManagerContract
5757
*/
58-
public function delete(string $path = null): self;
58+
public function delete(?string $path = null): self;
5959

6060
/**
6161
* Deletes multiple setting items in a single operation.

src/Managers/AbstractSettingsManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function has(string $path): bool
122122
* @param null $default
123123
* @return array|\ArrayAccess|mixed
124124
*/
125-
public function get(string $path = null, $default = null)
125+
public function get(?string $path = null, $default = null)
126126
{
127127
return $path ? Arr::get($this->all(), $path, $default) : $this->all();
128128
}
@@ -132,7 +132,7 @@ public function get(string $path = null, $default = null)
132132
* @param null $default
133133
* @return array
134134
*/
135-
public function getMultiple(iterable $paths = null, $default = null): array
135+
public function getMultiple(?iterable $paths = null, $default = null): array
136136
{
137137
$array = [];
138138
$allFlattened = $this->allFlattened();
@@ -178,7 +178,7 @@ public function update(string $path, $value): SettingsManagerContract
178178
* @param string|null $path
179179
* @return \Glorand\Model\Settings\Contracts\SettingsManagerContract
180180
*/
181-
public function delete(string $path = null): SettingsManagerContract
181+
public function delete(?string $path = null): SettingsManagerContract
182182
{
183183
if (!$path) {
184184
$settings = [];

src/Traits/HasSettingsRedis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function getSettingsValue(): array
3232
return is_array($value) ? $value : [];
3333
}
3434

35-
public function cacheKey(string $key = null): string
35+
public function cacheKey(?string $key = null): string
3636
{
3737
return sprintf(
3838
"r-k-%s:%s",

0 commit comments

Comments
 (0)