Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
Add type hints to lambda parameters.
Browse files Browse the repository at this point in the history
Summary: required for .hhconfig disallow_ambiguous_lambda.

Signed-off-by: Arthur Loiret <[email protected]>
  • Loading branch information
aloiret-ed authored and fredemmott committed Jul 15, 2019
1 parent 8a88ee1 commit 9bb2f65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion bin/naive-benchmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ private static function testImplementation(
$expected_responder,
$responder,
);
$pretty_data = $dict ==> \var_export($dict, true)
$pretty_data = (
dict<string, string> $dict
) ==> \var_export($dict, true)
|> Str\split($$, "\n")
|> Vec\map($$, $line ==> ' '.$line)
|> Str\join($$, "\n");
Expand Down
5 changes: 3 additions & 2 deletions src/request-parameters/RequestParametersBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ public function __construct(
KeyedTraversable<string, string> $values,
) {
$this->values = new ImmMap($values);
$spec_vector_to_map = $specs ==>
Dict\pull($specs, $it ==> $it, $it ==> $it->getName());
$spec_vector_to_map = (
Traversable<RequestParameter> $specs
) ==> Dict\pull($specs, $it ==> $it, $it ==> $it->getName());

$this->requiredSpecs = $spec_vector_to_map($required_specs);
$this->optionalSpecs = $spec_vector_to_map($optional_specs);
Expand Down

0 comments on commit 9bb2f65

Please sign in to comment.