Skip to content
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

Incorrect argument type definition in addHtml method #313

Open
mskocik opened this issue Jun 13, 2024 · 1 comment · May be fixed by #314
Open

Incorrect argument type definition in addHtml method #313

mskocik opened this issue Jun 13, 2024 · 1 comment · May be fixed by #314

Comments

@mskocik
Copy link

mskocik commented Jun 13, 2024

Version: latest

Bug Description

Method addHtml() has mixed type definition, which is incorrect. In fact it really expects HtmlStringable|string, because of inner call of ->insert().

The same applies to addText().

Steps To Reproduce

Html::el('span')->addHtml(0); // results in following TypeError

TypeError Nette\Utils\Html::insert(): Argument #2 ($child) must be of type Nette\HtmlStringable|string, int given

Expected Behavior

No type error being thrown

@dg
Copy link
Member

dg commented Jun 13, 2024

Please send PR

@mskocik mskocik changed the title Incorrect argument type definition in addHtml and addText methods Incorrect argument type definition in addHtml methods Jun 13, 2024
@mskocik mskocik linked a pull request Jun 13, 2024 that will close this issue
@mskocik mskocik changed the title Incorrect argument type definition in addHtml methods Incorrect argument type definition in addHtml method Jun 13, 2024
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 a pull request may close this issue.

2 participants