idx is NOT a builtin

@seanc This is the second time... Third time we should figure out a solution
Esse commit está contido em:
Paul Tarjan
2013-05-20 16:01:56 -07:00
commit de Sara Golemon
commit 9006ed7c1b
+5 -1
Ver Arquivo
@@ -1,5 +1,9 @@
<?hh
function mapLookup($map, $key, $default) {
return $map->containsKey($key) ? $map[$key] : $default;
}
final class HTTPHeaders {
private $headers;
@@ -15,7 +19,7 @@ final class HTTPHeaders {
}
public function getHeader(string $name, ?string $default = null): ?string {
return idx($this->getAllHeaders(), strtolower($name), $default);
return mapLookup($this->getAllHeaders(), strtolower($name), $default);
}
}