Skip to content

Fixed up chaotic addClass() docblock types. #18360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2025
Merged

Fixed up chaotic addClass() docblock types. #18360

merged 1 commit into from
Apr 19, 2025

Conversation

dereuromark
Copy link
Member

In the future maybe we can split those based on array vs string.
And the input type wouldnt need to be mixed IMO, but array|string.

@dereuromark dereuromark added this to the 5.2.3 milestone Apr 19, 2025
@@ -346,7 +346,7 @@ protected function _formatAttribute(string $key, mixed $value, bool $escape = tr
/**
* Adds a class and returns a unique list either in array or space separated
*
* @param mixed $input The array or string to add the class to
* @param array<string, mixed>|string|null $input The array or string to add the class to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual types include false too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not documented and untested apparently :) I wonder if we should add as "expected inputs".

@markstory markstory merged commit f9763bd into 5.x Apr 19, 2025
13 checks passed
@markstory markstory deleted the 5.x-docblock branch April 19, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants