1313
1414use PHPUnit \Framework \TestCase ;
1515use Twig \Error \RuntimeError ;
16- use Twig \Extra \Html \HtmlAttr \AttributeValueInterface ;
1716use Twig \Extra \Html \HtmlAttr \MergeableInterface ;
1817use Twig \Extra \Html \HtmlExtension ;
1918
@@ -22,7 +21,7 @@ class HtmlAttrMergeTest extends TestCase
2221 /**
2322 * @dataProvider htmlAttrProvider
2423 */
25- public function testMerge (array $ expected , array $ inputs ): void
24+ public function testMerge (array $ expected , array $ inputs )
2625 {
2726 $ result = HtmlExtension::htmlAttrMerge (...$ inputs );
2827
@@ -181,7 +180,7 @@ public static function htmlAttrProvider(): \Generator
181180 ];
182181 }
183182
184- public function testIncompatibleValuesMergeThrowsException (): void
183+ public function testIncompatibleValuesMergeThrowsException ()
185184 {
186185 $ this ->expectException (RuntimeError::class);
187186 $ this ->expectExceptionMessage ('Cannot merge incompatible values for key "test" ' );
@@ -202,16 +201,18 @@ public function __construct(private readonly mixed $value)
202201 public function mergeInto (mixed $ previous ): self
203202 {
204203 $ previousValue = $ previous instanceof self ? $ previous ->value : $ previous ;
204+
205205 return new self ("merged: {$ previousValue } + {$ this ->value }" );
206206 }
207207
208208 public function appendFrom (mixed $ newValue ): self
209209 {
210- if (is_array ($ newValue )) {
210+ if (\ is_array ($ newValue )) {
211211 $ newValue = implode (', ' , $ newValue );
212212 } elseif ($ newValue instanceof self) {
213213 $ newValue = $ newValue ->value ;
214214 }
215+
215216 return new self ("appended: {$ this ->value } + {$ newValue }" );
216217 }
217218
0 commit comments