Skip to content

Conversation

Muurtaja
Copy link

This commit fixes a type error in the UserDataTable class by explicitly typing the $actions property as an array. This change aligns with the expected type in the Yajra\DataTables\Services\DataTable class, preventing runtime errors and ensuring consistent data handling.

  • Updated the $actions property declaration from protected $actions = ['print', 'excel', 'myCustomAction']; to protected array $actions = ['print', 'excel', 'myCustomAction'];.
  • This change leverages PHP's property type declaration feature to enforce that $actions is always an array.
  • The modification enhances code robustness and readability, ensuring type safety and preventing potential issues related to incorrect data types.

By making this update, the UserDataTable class now correctly adheres to the expected data structure, improving overall stability and maintainability.

…aTable

This commit fixes a type error in the UserDataTable class by explicitly typing the $actions property as an array. This change aligns with the expected type in the Yajra\DataTables\Services\DataTable class, preventing runtime errors and ensuring consistent data handling.

- Updated the $actions property declaration from `protected $actions = ['print', 'excel', 'myCustomAction'];` to `protected array $actions = ['print', 'excel', 'myCustomAction'];`.
- This change leverages PHP's property type declaration feature to enforce that $actions is always an array.
- The modification enhances code robustness and readability, ensuring type safety and preventing potential issues related to incorrect data types.

By making this update, the UserDataTable class now correctly adheres to the expected data structure, improving overall stability and maintainability.
@yajra yajra merged commit f029b90 into yajra:master May 26, 2024
@yajra
Copy link
Owner

yajra commented May 26, 2024

Thanks!

@Muurtaja Muurtaja deleted the patch-1 branch May 26, 2024 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants