Background
The FieldTypeInterface::render() method in src/Component/FieldTypes/FieldTypeInterface.php currently has a $data parameter without an explicit type declaration. The docblock indicates @param mixed $data, but the parameter itself lacks the mixed type hint.
Current Implementation
public function render(Field $field, $data, array $options);
Proposal
Add the explicit mixed type to the $data parameter to align with modern PHP standards and maintain backward compatibility:
public function render(Field $field, mixed $data, array $options);
Benefits
- Aligns the method signature with its documented behavior
- Improves type safety and IDE support
- Prepares the codebase for stricter type enforcement in future PHP versions
- Maintains backward compatibility as
mixed accepts any type
Related Files
src/Component/FieldTypes/FieldTypeInterface.php
- All implementations of
FieldTypeInterface will need to be updated accordingly
Tasks
Background
The
FieldTypeInterface::render()method insrc/Component/FieldTypes/FieldTypeInterface.phpcurrently has a$dataparameter without an explicit type declaration. The docblock indicates@param mixed $data, but the parameter itself lacks themixedtype hint.Current Implementation
Proposal
Add the explicit
mixedtype to the$dataparameter to align with modern PHP standards and maintain backward compatibility:Benefits
mixedaccepts any typeRelated Files
src/Component/FieldTypes/FieldTypeInterface.phpFieldTypeInterfacewill need to be updated accordinglyTasks
FieldTypeInterface::render()to includemixedtype for$dataparameterFieldTypeInterfacein the codebase