Skip to content

Commit

Permalink
Html: proper types for setHtml and addHtml methods – same as insert()…
Browse files Browse the repository at this point in the history
… method
  • Loading branch information
vitkutny committed Jul 12, 2023
1 parent 6ec9016 commit 81750f6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ parameters:
- stubs/Forms/Container.stub
- stubs/Forms/Form.stub
- stubs/Forms/Rules.stub
- stubs/HtmlStringable.stub
- stubs/Http/SessionSection.stub
- stubs/Routing/Router.stub
- stubs/Utils/ArrayHash.stub
Expand Down
8 changes: 8 additions & 0 deletions stubs/HtmlStringable.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Nette;

interface HtmlStringable extends \Stringable
{

}
18 changes: 18 additions & 0 deletions stubs/Utils/Html.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Nette\Utils;

use Nette\HtmlStringable;

/**
* @implements \IteratorAggregate<int, self|string>
* @implements \ArrayAccess<int, self|string>
Expand All @@ -17,4 +19,20 @@ class Html implements \ArrayAccess, \IteratorAggregate
// nothing
}

/**
* @param string|HtmlStringable $html
*/
public function setHtml(mixed $html): static
{
// nothing
}

/**
* @param string|HtmlStringable $child
*/
final public function addHtml(mixed $child): static
{
// nothing
}

}

0 comments on commit 81750f6

Please sign in to comment.