utils icon indicating copy to clipboard operation
utils copied to clipboard

Incorrect argument type definition in `addHtml` method

Open mskocik opened this issue 1 year ago • 1 comments

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

mskocik avatar Jun 13 '24 10:06 mskocik

Please send PR

dg avatar Jun 13 '24 11:06 dg