Skip to content

Commit eb67605

Browse files
committed
feature #1027 Fix ComponentAttributes constructor typehint and remove @internal (norkunas)
This PR was merged into the 2.x branch. Discussion ---------- Fix ComponentAttributes constructor typehint and remove ``@internal`` | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Tickets | Fix #304 | License | MIT I heavily rely on ComponentAttributes instantiation in components to be able to use same logic on all component elements, for example: ```twig <div{{ attributes.defaults({ ... })> <img{{ imageAttributes.defaults({ ... })> </div> ``` In the issue it was proposed to rename ComponentAttributes but I don't see the point to break the code for people now 🙂 Commits ------- 70d3a78c Fix ComponentAttributes constructor typehint and remove internal
2 parents 02bb577 + becc616 commit eb67605

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/ComponentAttributes.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
final class ComponentAttributes
2323
{
2424
/**
25-
* @internal
26-
*
27-
* @param array<string, string> $attributes
25+
* @param array<string, string|bool> $attributes
2826
*/
2927
public function __construct(private array $attributes)
3028
{
@@ -53,7 +51,7 @@ function (string $carry, string $key) {
5351
}
5452

5553
/**
56-
* @return array<string, string>
54+
* @return array<string, string|bool>
5755
*/
5856
public function all(): array
5957
{

0 commit comments

Comments
 (0)