Fixes test suite

This commit is contained in:
Nuno Maduro
2024-04-27 11:36:22 +01:00
parent f49d1e0e18
commit cfa00da885
15 changed files with 161 additions and 51 deletions

View File

@ -13,6 +13,8 @@ final class Attributes
{
/**
* Evaluates the given attributes and returns the code.
*
* @param iterable<int, Attribute> $attributes
*/
public static function code(iterable $attributes): string
{
@ -23,9 +25,9 @@ final class Attributes
return " #[\\{$name}]";
}
$arguments = array_map(fn (string $argument): string => var_export($argument, true), $attribute->arguments);
$arguments = array_map(fn (string $argument): string => var_export($argument, true), iterator_to_array($attribute->arguments));
return sprintf(' #[\\%s(%s)]', $name, implode(', ', $arguments));
}, $attributes));
}, iterator_to_array($attributes)));
}
}