Skip to content

Commit

Permalink
Replace PHP arrays with varray and darray
Browse files Browse the repository at this point in the history
Grepped for \barray\b , fixed all call sites.

No log spew on test run
  • Loading branch information
fredemmott committed Jun 9, 2020
1 parent 7dd1a68 commit 0e73e62
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/BaseCodeBuilder.hack
Original file line number Diff line number Diff line change
Expand Up @@ -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<mixed> $args): this {
final protected function addvf(string $code, varray<mixed> $args): this {
if ($code === null) {
return $this;
}
Expand Down Expand Up @@ -190,7 +190,7 @@ abstract class BaseCodeBuilder {
* insert a newline. */
final protected function addLineImplvf(
?string $code,
array<mixed> $args,
varray<mixed> $args,
): this {
return $this->addvf((string)$code, $args)->newLine();
}
Expand Down
4 changes: 2 additions & 2 deletions src/key-value-render/HackBuilderValues.hack
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ abstract final class HackBuilderValues {
/** Render a `vec`-like PHP array literal */
public static function valueArray<Tv>(
IHackBuilderValueRenderer<Tv> $vr,
): IHackBuilderValueRenderer<array<Tv>> {
): IHackBuilderValueRenderer<varray<Tv>> {
return new _Private\HackBuilderNativeValueCollectionRenderer(
ContainerType::PHP_ARRAY,
$vr,
Expand All @@ -62,7 +62,7 @@ abstract final class HackBuilderValues {
public static function keyValueArray<Tk as arraykey, Tv>(
IHackBuilderKeyRenderer<Tk> $kr,
IHackBuilderValueRenderer<Tv> $vr,
): IHackBuilderValueRenderer<array<Tk, Tv>> {
): IHackBuilderValueRenderer<darray<Tk, Tv>> {
return new _Private\HackBuilderNativeKeyValueCollectionRenderer(
ContainerType::PHP_ARRAY,
$kr,
Expand Down

0 comments on commit 0e73e62

Please sign in to comment.