Skip to content

Commit f457a3d

Browse files
committed
Update hh-apidoc to v0.8
v0.8 got more picky about various pre-existing bugs refs #1125
1 parent 0970667 commit f457a3d

File tree

5 files changed

+24
-15
lines changed

5 files changed

+24
-15
lines changed

composer.lock

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api-gen/ScannedDefinitionFilters.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
ScannedDefinition,
1818
ScannedFunction,
1919
ScannedFunctionish,
20+
ScannedMethod,
2021
ScannedNewtype,
2122
ScannedType,
2223
};
@@ -72,7 +73,6 @@ public static function isHHSpecific(ScannedDefinition $def): bool {
7273
) {
7374
return true;
7475
}
75-
7676
return false;
7777
}
7878

@@ -87,8 +87,10 @@ private static function getPHPList(string $type): keyset<string> {
8787

8888
public static function shouldNotDocument(ScannedDefinition $def): bool {
8989
return (
90-
Str\starts_with($def->getName(), '_') // non-namespaced name starts with _
91-
||
90+
(
91+
// non-namespaced name starts with _
92+
Str\starts_with($def->getName(), '_') && !($def is ScannedMethod)
93+
) ||
9294
Str\contains($def->getName(), '\\_') // namespaced name starts with _
9395
||
9496
Str\contains($def->getName(), 'WaitHandle') ||

src/build/HHAPIDocBuildStep.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,9 @@ private static function buildMarkdown(
379379
// Empty index; this is used for auto-linking, but we do that when
380380
// processing the markdown, instead of when generating it.
381381
shape(
382-
'types' => keyset[],
383-
'newtypes' => keyset[],
384-
'functions' => keyset[],
382+
'types' => dict[],
383+
'newtypes' => dict[],
384+
'functions' => dict[],
385385
'classes' => dict[],
386386
'interfaces' => dict[],
387387
'traits' => dict[],
@@ -391,6 +391,7 @@ private static function buildMarkdown(
391391
'format' => HHAPIDoc\OutputFormat::MARKDOWN,
392392
'syntaxHighlighting' => true,
393393
'hidePrivateMethods' => true,
394+
'hideInheritedMethods' => false,
394395
),
395396
)
396397
);

src/hh-apidoc-extensions/PathProvider.php

+7
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,21 @@ public function __construct() {
2626
public function getPathForClass(string $class): ?string {
2727
return $this->providers
2828
|> Vec\map($$, $p ==> $p->getPathForClass($class))
29+
|> Vec\filter_nulls($$)
2930
|> C\first($$);
3031
}
3132

3233
public function getPathForInterface(string $class): ?string {
3334
return $this->providers
3435
|> Vec\map($$, $p ==> $p->getPathForInterface($class))
36+
|> Vec\filter_nulls($$)
3537
|> C\first($$);
3638
}
3739

3840
public function getPathForTrait(string $class): ?string {
3941
return $this->providers
4042
|> Vec\map($$, $p ==> $p->getPathForTrait($class))
43+
|> Vec\filter_nulls($$)
4144
|> C\first($$);
4245
}
4346

@@ -47,6 +50,7 @@ public function getPathForClassMethod(
4750
): ?string {
4851
return $this->providers
4952
|> Vec\map($$, $p ==> $p->getPathForClassMethod($class, $method))
53+
|> Vec\filter_nulls($$)
5054
|> C\first($$);
5155
}
5256

@@ -56,6 +60,7 @@ public function getPathForInterfaceMethod(
5660
): ?string {
5761
return $this->providers
5862
|> Vec\map($$, $p ==> $p->getPathForInterfaceMethod($class, $method))
63+
|> Vec\filter_nulls($$)
5964
|> C\first($$);
6065
}
6166

@@ -65,12 +70,14 @@ public function getPathForTraitMethod(
6570
): ?string {
6671
return $this->providers
6772
|> Vec\map($$, $p ==> $p->getPathForTraitMethod($trait, $method))
73+
|> Vec\filter_nulls($$)
6874
|> C\first($$);
6975
}
7076

7177
public function getPathForFunction(string $function): ?string {
7278
return $this->providers
7379
|> Vec\map($$, $p ==> $p->getPathForFunction($function))
80+
|> Vec\filter_nulls($$)
7481
|> C\first($$);
7582
}
7683

src/hh-apidoc-extensions/ProductPathProvider.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ protected function getPathForClassishMethod(
4646
if ($class === null) {
4747
return null;
4848
}
49-
$method = $class['methods'][$method] ?? null;
50-
return $method === null ? null : $method['urlPath'];
49+
return $class['methods'][$method]['urlPath'] ?? null;
5150
}
5251

5352
public function getPathForFunction(string $function): ?string {

0 commit comments

Comments
 (0)