Skip to content

Commit 3e5002c

Browse files
committed
Add twig config block
1 parent e0a9d5c commit 3e5002c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Compiler.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ class Compiler
110110
*/
111111
protected $attributesWithIf = ['checked', 'selected', 'disabled'];
112112

113-
114-
115113
/**
116114
* Compiler constructor.
117115
*/
@@ -233,9 +231,7 @@ private function handleTwigConfig(string $twigConfig): void
233231
$config = parse_ini_string($twigConfig);
234232
if ($config['attributes-with-if'] ?? false) {
235233
$attributes = explode(',', $config['attributes-with-if']);
236-
foreach ($attributes as &$attribute) {
237-
$attribute = trim($attribute);
238-
}
234+
$attributes = array_map(function ($item) { return trim($item); }, $attributes);
239235
$this->attributesWithIf = array_merge($this->attributesWithIf, $attributes);
240236
}
241237
}

0 commit comments

Comments
 (0)