Skip to content

Conversation

@sukhwinder33445
Copy link
Contributor

This fixes the confusion of phpstan. Since the createElement() element returns an instance of FormElement, phpstan cannot find an addHtml() method for it, for example. The return type must therefore be FormElement & BaseHtmlElement.

@sukhwinder33445 sukhwinder33445 self-assigned this May 3, 2024
@cla-bot cla-bot bot added the cla/signed label May 3, 2024
@sukhwinder33445 sukhwinder33445 marked this pull request as draft May 3, 2024 08:23
@sukhwinder33445 sukhwinder33445 force-pushed the fix-return-type branch 2 times, most recently from 53da7c1 to 828ccf0 Compare May 3, 2024 13:01
… code

This fixes the confusion of phpstan. Since the `createElement()` element returns an instance
of `FormElement`, phpstan cannot find an `addHtml()` method for it, for example.
The return type must therefore be `FormElement & BaseHtmlElement`.
Since `ValidatorChain::addValidators($param)` requires $param of the type `Traversable<int|string, mixed>`, this class should reflect it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants