Skip to content

Commit dbf448a

Browse files
Merge pull request #27 from TheDragonCode/4.x
Added missing typing
2 parents 6ad243a + 4a7bb18 commit dbf448a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Concerns/HasCases.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
trait HasCases
2424
{
25-
protected $case = self::NO_CASE;
25+
protected int $case = self::NO_CASE;
2626

2727
/**
2828
* @param int $type

src/Concerns/HasCastable.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,25 @@
1717

1818
namespace DragonCode\PrettyArray\Concerns;
1919

20+
use DragonCode\Support\Facades\Helpers\Boolean;
21+
2022
trait HasCastable
2123
{
2224
/**
2325
* Castable value.
2426
*
25-
* @param mixed $value
27+
* @param mixed|null $value
2628
*
27-
* @return mixed
29+
* @return string|int|float
2830
*/
29-
protected function castValue($value = null)
31+
protected function castValue(mixed $value = null): string|int|float
3032
{
3133
if (is_numeric($value)) {
3234
return $value;
3335
}
3436

3537
if (is_bool($value)) {
36-
return $value ? 'true' : 'false';
38+
return Boolean::toString($value);
3739
}
3840

3941
if (is_null($value)) {

0 commit comments

Comments
 (0)