Skip to content

Incorrect argument type definition in addHtml method #313

@mskocik

Description

@mskocik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions