Skip to content

Commit 71ae7ad

Browse files
committed
small fix on test
1 parent c74271b commit 71ae7ad

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

src/TwigComponent/src/Twig/AttributeBag.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,6 @@ public function __toString(): string
164164
$value = $key;
165165
}
166166

167-
if (\is_array($value)) {
168-
$convertedArray = '[';
169-
foreach ($value as $key => $item) {
170-
$convertedArray .= $key.'=>'.$item.',';
171-
}
172-
173-
$convertedArray = rtrim($convertedArray, ',');
174-
$convertedArray .= ']';
175-
$value = $convertedArray;
176-
}
177-
178167
$string .= ' '.$key.'="'.str_replace('"', '\\"', trim($value)).'"';
179168
}
180169

src/TwigComponent/tests/Fixtures/Component/Table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
final class Table
99
{
1010
public ?string $caption = null;
11-
public array $headers = ['key', 'value'];
12-
public array $data = [[1, 2], [3, 4]];
11+
public array $headers;
12+
public array $data;
1313
}

src/TwigComponent/tests/Fixtures/templates/components/table.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<table{{ attributes }}>
1+
<table>
22
{% if this.caption %}
33
<caption>{{ this.caption }}</caption>
44
{% endif %}

src/TwigComponent/tests/Fixtures/templates/slot/render_block.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<twig:table caption='data table'>
1+
<twig:table caption='data table' :headers="['key', 'value']" :data="[[1, 2], [3, 4]]">
22
{% block th %}custom th ({{ parent() }}){% endblock %}
33
{% block td %}custom td ({{ parent() }}){% endblock %}
44

0 commit comments

Comments
 (0)