From 0e73e6249e791204f697eba03f2f31e8f914787a Mon Sep 17 00:00:00 2001 From: Fred Emmott Date: Tue, 9 Jun 2020 09:57:33 -0700 Subject: [PATCH] Replace PHP arrays with varray and darray Grepped for \barray\b , fixed all call sites. No log spew on test run --- composer.json | 2 +- src/BaseCodeBuilder.hack | 4 ++-- src/key-value-render/HackBuilderValues.hack | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 8f2edca6..1ccf55d7 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "type": "library", "require-dev": { "hhvm/hacktest": "^2.0", - "hhvm/type-assert": "^3.1", + "hhvm/type-assert": "^3.1|^4.0", "facebook/fbexpect": "^2.6.1", "hhvm/hhast": "^4.0", "facebook/difflib": "^1.0" diff --git a/src/BaseCodeBuilder.hack b/src/BaseCodeBuilder.hack index 4288b85c..f9c2bc63 100644 --- a/src/BaseCodeBuilder.hack +++ b/src/BaseCodeBuilder.hack @@ -124,7 +124,7 @@ abstract class BaseCodeBuilder { * * This is unsafe. Use `addf` instead if you have a literal format string. */ - final protected function addvf(string $code, array $args): this { + final protected function addvf(string $code, varray $args): this { if ($code === null) { return $this; } @@ -190,7 +190,7 @@ abstract class BaseCodeBuilder { * insert a newline. */ final protected function addLineImplvf( ?string $code, - array $args, + varray $args, ): this { return $this->addvf((string)$code, $args)->newLine(); } diff --git a/src/key-value-render/HackBuilderValues.hack b/src/key-value-render/HackBuilderValues.hack index 598890dc..be9ff01e 100644 --- a/src/key-value-render/HackBuilderValues.hack +++ b/src/key-value-render/HackBuilderValues.hack @@ -51,7 +51,7 @@ abstract final class HackBuilderValues { /** Render a `vec`-like PHP array literal */ public static function valueArray( IHackBuilderValueRenderer $vr, - ): IHackBuilderValueRenderer> { + ): IHackBuilderValueRenderer> { return new _Private\HackBuilderNativeValueCollectionRenderer( ContainerType::PHP_ARRAY, $vr, @@ -62,7 +62,7 @@ abstract final class HackBuilderValues { public static function keyValueArray( IHackBuilderKeyRenderer $kr, IHackBuilderValueRenderer $vr, - ): IHackBuilderValueRenderer> { + ): IHackBuilderValueRenderer> { return new _Private\HackBuilderNativeKeyValueCollectionRenderer( ContainerType::PHP_ARRAY, $kr,