Skip to content

Commit 6a06ced

Browse files
viratyosinfacebook-github-bot
authored andcommitted
Str\join takes readonly
Summary: Technically, traversal over readonly non-Containers isn't correct, but we're ignoring that for now -- analogous to how we're pretending traversal is always pure. Reviewed By: jamesjwu Differential Revision: D32027704 fbshipit-source-id: 220e9c7bb46e08fab7111d2b1d4e40d76aa8b90a
1 parent c367a23 commit 6a06ced

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/str/combine.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
* Previously known as `implode` in PHP.
2020
*/
2121
function join(
22-
Traversable<arraykey> $pieces,
22+
readonly Traversable<arraykey> $pieces,
2323
string $glue,
2424
)[]: string {
2525
if ($pieces is Container<_>) {
2626
return \implode($glue, $pieces);
2727
}
28-
return \implode($glue, Vec\cast_clear_legacy_array_mark($pieces));
28+
return \implode($glue, vec($pieces));
2929
}

0 commit comments

Comments
 (0)