Skip to content

Commit fd086cf

Browse files
committed
apply code suggestions
1 parent 078fa0c commit fd086cf

File tree

4 files changed

+7
-25
lines changed

4 files changed

+7
-25
lines changed

system/DataCaster/Cast/CastInterface.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ interface CastInterface
1818
/**
1919
* Takes a value from DataSource, returns its value for PHP.
2020
*
21-
* @param mixed $value Data from database driver
22-
* @param list<string> $params Additional param
23-
* @param object|null $helper Helper object. E.g., database connection
21+
* @param mixed $value Data from database driver
22+
* @param array<int, string> $params Additional param
23+
* @param object|null $helper Helper object. E.g., database connection
2424
*
2525
* @return mixed PHP native value
2626
*/
@@ -33,9 +33,9 @@ public static function get(
3333
/**
3434
* Takes a PHP value, returns its value for DataSource.
3535
*
36-
* @param mixed $value PHP native value
37-
* @param list<string> $params Additional param
38-
* @param object|null $helper Helper object. E.g., database connection
36+
* @param mixed $value PHP native value
37+
* @param array<int, string> $params Additional param
38+
* @param object|null $helper Helper object. E.g., database connection
3939
*
4040
* @return mixed Data to pass to database driver
4141
*/

system/DataCaster/Cast/EnumCast.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
*/
2929
class EnumCast extends BaseCast implements CastInterface
3030
{
31-
/**
32-
* @param array<int, string> $params
33-
*/
3431
public static function get(
3532
mixed $value,
3633
array $params = [],
@@ -83,9 +80,6 @@ public static function get(
8380
return $enum;
8481
}
8582

86-
/**
87-
* @param array<int, string> $params
88-
*/
8983
public static function set(
9084
mixed $value,
9185
array $params = [],

system/Entity/Cast/EnumCast.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,8 @@
1818
use ReflectionEnum;
1919
use UnitEnum;
2020

21-
/**
22-
* Class EnumCast
23-
*
24-
* Handles casting for PHP enums (both backed and unit enums)
25-
*/
2621
class EnumCast extends BaseCast
2722
{
28-
/**
29-
* {@inheritDoc}
30-
*/
3123
public static function get($value, array $params = [])
3224
{
3325
$enumClass = $params[0] ?? null;
@@ -72,10 +64,7 @@ public static function get($value, array $params = [])
7264
throw CastException::forInvalidEnumCaseName($enumClass, $value);
7365
}
7466

75-
/**
76-
* {@inheritDoc}
77-
*/
78-
public static function set($value, array $params = []): int|string|null
67+
public static function set($value, array $params = []): int|string
7968
{
8069
// Get the expected enum class
8170
$enumClass = $params[0] ?? null;

user_guide_src/source/models/entities.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ Enum casting supports:
301301

302302
* **Backed enums** (string or int) - The backing value is stored in the database
303303
* **Unit enums** - The case name is stored in the database as a string
304-
* **Nullable enums** - Use the ``?`` prefix
305304

306305
For example, if you had a User entity with a ``status`` property using a backed enum:
307306

0 commit comments

Comments
 (0)