Html: proper types for setHtml and addHtml methods – same as insert() method#128
Html: proper types for setHtml and addHtml methods – same as insert() method#128vitkutny wants to merge 2 commits intophpstan:1.1.xfrom
Conversation
|
Please show a piece of code for which "Nette\Utils\Html::insert(): Argument #2 ($child) must be of type Nette\HtmlStringable|string, XY given" is currently reported and which this PR should fix. Also - did you first try to send a PR to https://github.com/nette/utils? |
c9eae73 to
c82fd5b
Compare
namespace Nette\Utils;
class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringable
{
/**
* Adds new element's child.
*/
final public function addHtml(mixed $child): static
{
return $this->insert(null, $child);
}
/**
* Inserts child node.
*/
public function insert(?int $index, HtmlStringable|string $child, bool $replace = false): static
{
}
}
Right, I did not. I will :-) |
fixes
Nette\Utils\Html::insert(): Argument #2 ($child) must be of type Nette\HtmlStringable|string, XY given