Skip to content

Commit 0e73e62

Browse files
committed
Replace PHP arrays with varray and darray
Grepped for \barray\b , fixed all call sites. No log spew on test run
1 parent 7dd1a68 commit 0e73e62

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"type": "library",
3434
"require-dev": {
3535
"hhvm/hacktest": "^2.0",
36-
"hhvm/type-assert": "^3.1",
36+
"hhvm/type-assert": "^3.1|^4.0",
3737
"facebook/fbexpect": "^2.6.1",
3838
"hhvm/hhast": "^4.0",
3939
"facebook/difflib": "^1.0"

src/BaseCodeBuilder.hack

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ abstract class BaseCodeBuilder {
124124
*
125125
* This is unsafe. Use `addf` instead if you have a literal format string.
126126
*/
127-
final protected function addvf(string $code, array<mixed> $args): this {
127+
final protected function addvf(string $code, varray<mixed> $args): this {
128128
if ($code === null) {
129129
return $this;
130130
}
@@ -190,7 +190,7 @@ abstract class BaseCodeBuilder {
190190
* insert a newline. */
191191
final protected function addLineImplvf(
192192
?string $code,
193-
array<mixed> $args,
193+
varray<mixed> $args,
194194
): this {
195195
return $this->addvf((string)$code, $args)->newLine();
196196
}

src/key-value-render/HackBuilderValues.hack

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ abstract final class HackBuilderValues {
5151
/** Render a `vec`-like PHP array literal */
5252
public static function valueArray<Tv>(
5353
IHackBuilderValueRenderer<Tv> $vr,
54-
): IHackBuilderValueRenderer<array<Tv>> {
54+
): IHackBuilderValueRenderer<varray<Tv>> {
5555
return new _Private\HackBuilderNativeValueCollectionRenderer(
5656
ContainerType::PHP_ARRAY,
5757
$vr,
@@ -62,7 +62,7 @@ abstract final class HackBuilderValues {
6262
public static function keyValueArray<Tk as arraykey, Tv>(
6363
IHackBuilderKeyRenderer<Tk> $kr,
6464
IHackBuilderValueRenderer<Tv> $vr,
65-
): IHackBuilderValueRenderer<array<Tk, Tv>> {
65+
): IHackBuilderValueRenderer<darray<Tk, Tv>> {
6666
return new _Private\HackBuilderNativeKeyValueCollectionRenderer(
6767
ContainerType::PHP_ARRAY,
6868
$kr,

0 commit comments

Comments
 (0)