Skip to content

Commit 81750f6

Browse files
committed
Html: proper types for setHtml and addHtml methods – same as insert() method
1 parent 6ec9016 commit 81750f6

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

Diff for: extension.neon

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ parameters:
1818
- stubs/Forms/Container.stub
1919
- stubs/Forms/Form.stub
2020
- stubs/Forms/Rules.stub
21+
- stubs/HtmlStringable.stub
2122
- stubs/Http/SessionSection.stub
2223
- stubs/Routing/Router.stub
2324
- stubs/Utils/ArrayHash.stub

Diff for: stubs/HtmlStringable.stub

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Nette;
4+
5+
interface HtmlStringable extends \Stringable
6+
{
7+
8+
}

Diff for: stubs/Utils/Html.stub

+18
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Nette\Utils;
44

5+
use Nette\HtmlStringable;
6+
57
/**
68
* @implements \IteratorAggregate<int, self|string>
79
* @implements \ArrayAccess<int, self|string>
@@ -17,4 +19,20 @@ class Html implements \ArrayAccess, \IteratorAggregate
1719
// nothing
1820
}
1921

22+
/**
23+
* @param string|HtmlStringable $html
24+
*/
25+
public function setHtml(mixed $html): static
26+
{
27+
// nothing
28+
}
29+
30+
/**
31+
* @param string|HtmlStringable $child
32+
*/
33+
final public function addHtml(mixed $child): static
34+
{
35+
// nothing
36+
}
37+
2038
}

0 commit comments

Comments
 (0)