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

Commit 59da826

Browse files
lexidorAtry
authored andcommitted
Fix lints
1 parent 3d6db89 commit 59da826

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/router/BaseRouter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final public function routeMethodAndPath(
2424
$resolver = $this->getResolver();
2525
try {
2626
list($responder, $data) = $resolver->resolve($method, $path);
27-
$data = Dict\map($data, $value ==> \urldecode($value));
27+
$data = Dict\map($data, \urldecode<>);
2828
return tuple($responder, new ImmMap($data));
2929
} catch (NotFoundException $e) {
3030
$allowed = $this->getAllowedMethods($path);
@@ -36,7 +36,7 @@ final public function routeMethodAndPath(
3636
$method === HttpMethod::HEAD && $allowed === keyset[HttpMethod::GET]
3737
) {
3838
list($responder, $data) = $resolver->resolve(HttpMethod::GET, $path);
39-
$data = Dict\map($data, $value ==> \urldecode($value));
39+
$data = Dict\map($data, \urldecode<>);
4040
return tuple($responder, new ImmMap($data));
4141
}
4242

src/router/PrefixMatching/PrefixMap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ private static function groupByCommonPrefix(
147147
return tuple(0, dict[]);
148148
}
149149

150-
$lens = Vec\map($keys, $key ==> Str\length($key));
150+
$lens = Vec\map($keys, Str\length<>);
151151
$prefix_length = \min($lens);
152152
invariant($prefix_length !== 0, "Shouldn't have 0-length prefixes");
153153
return tuple(
154154
$prefix_length,
155155
$keys
156156
|> Dict\group_by($$, $key ==> Str\slice($key, 0, $prefix_length))
157-
|> Dict\map($$, $vec ==> keyset($vec)),
157+
|> Dict\map($$, keyset<>),
158158
);
159159
}
160160

src/router/PrefixMatchingResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(
2323
public static function fromFlatMap(
2424
dict<HttpMethod, dict<string, TResponder>> $map,
2525
): PrefixMatchingResolver<TResponder> {
26-
$map = Dict\map($map, $flat_map ==> PrefixMap::fromFlatMap($flat_map));
26+
$map = Dict\map($map, PrefixMap::fromFlatMap<>);
2727
return new self($map);
2828
}
2929

tests/RouterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function getAllResolvers(): vec<(
9696
tuple('simple regexp', $map ==> new SimpleRegexpResolver($map)),
9797
tuple(
9898
'prefix matching',
99-
$map ==> PrefixMatchingResolver::fromFlatMap($map),
99+
PrefixMatchingResolver::fromFlatMap<>,
100100
),
101101
];
102102
}

0 commit comments

Comments
 (0)