Skip to content

Commit a0cb185

Browse files
committed
apply code suggestions
1 parent fd086cf commit a0cb185

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

system/DataCaster/Cast/EnumCast.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static function get(
3232
mixed $value,
3333
array $params = [],
3434
?object $helper = null,
35-
): mixed {
35+
): BackedEnum|UnitEnum {
3636
if (! is_string($value) && ! is_int($value)) {
3737
self::invalidTypeValueError($value);
3838
}

system/Entity/Cast/EnumCast.php

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

2121
class EnumCast extends BaseCast
2222
{
23-
public static function get($value, array $params = [])
23+
public static function get($value, array $params = []): BackedEnum|UnitEnum
2424
{
2525
$enumClass = $params[0] ?? null;
2626

utils/phpstan-baseline/loader.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# total 2768 errors
1+
# total 2767 errors
22

33
includes:
44
- argument.type.neon

utils/phpstan-baseline/missingType.iterableValue.neon

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# total 1362 errors
1+
# total 1361 errors
22

33
parameters:
44
ignoreErrors:
@@ -2417,11 +2417,6 @@ parameters:
24172417
count: 1
24182418
path: ../../system/Entity/Cast/EnumCast.php
24192419

2420-
-
2421-
message: '#^Method CodeIgniter\\Entity\\Cast\\EnumCast\:\:get\(\) return type has no value type specified in iterable type array\.$#'
2422-
count: 1
2423-
path: ../../system/Entity/Cast/EnumCast.php
2424-
24252420
-
24262421
message: '#^Method CodeIgniter\\Entity\\Cast\\EnumCast\:\:set\(\) has parameter \$value with no value type specified in iterable type array\.$#'
24272422
count: 1

0 commit comments

Comments
 (0)