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

Commit 1e88409

Browse files
committed
Adapt to HHVM and HHAST 4.14
1 parent c5f101a commit 1e88409

15 files changed

+46
-50
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ sudo: required
22
language: generic
33
services: docker
44
env:
5-
- HHVM_VERSION=4.8-latest
5+
- HHVM_VERSION=4.14-latest
66
- HHVM_VERSION=latest
77
- HHVM_VERSION=nightly
88
install:

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"bin": [ "bin/hh-apidoc", "bin/hh-apidoc.hack" ],
44
"license": "MIT",
55
"require": {
6-
"hhvm": "^4.8",
6+
"hhvm": "^4.14",
77
"hhvm/hsl": "^4.0",
88
"facebook/fbmarkdown": "^1.0",
99
"facebook/hh-clilib": "^2.1.0",
1010
"facebook/definition-finder": "^2.0.0",
11-
"hhvm/hhast": "^4.8"
11+
"hhvm/hhast": "^4.14"
1212
},
1313
"require-dev": {
1414
"hhvm/hhvm-autoload": "^2.0"

src/MarkdownExt/AutoLinkifyFilter.hack

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class AutoLinkifyFilter extends Markdown\RenderFilter {
3535
Markdown\RenderContext $context,
3636
Markdown\ASTNode $node,
3737
): vec<Markdown\ASTNode> {
38-
if (!$node instanceof CodeSpan) {
38+
if (!$node is CodeSpan) {
3939
return vec[$node];
4040
}
4141

@@ -55,7 +55,7 @@ final class AutoLinkifyFilter extends Markdown\RenderFilter {
5555
}
5656

5757
invariant(
58-
$context instanceof RenderContext,
58+
$context is RenderContext,
5959
'Expected render context to be a %s',
6060
RenderContext::class,
6161
);
@@ -129,7 +129,7 @@ final class AutoLinkifyFilter extends Markdown\RenderFilter {
129129
}
130130

131131
$def = $context->getDocumentable()['definition'];
132-
if ($def instanceof ScannedClassish) {
132+
if ($def is ScannedClassish) {
133133
$path = self::getPathForMethod($context, $def->getName(), $search);
134134
if ($path !== null) {
135135
return $path;

src/MarkdownExt/SyntaxHighlightingFilter.hack

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ final class SyntaxHighlightingFilter extends Markdown\RenderFilter {
3333
Markdown\RenderContext $context,
3434
Markdown\ASTNode $node,
3535
): vec<Markdown\ASTNode> {
36-
if (!$node instanceof CodeBlock) {
36+
if (!$node is CodeBlock) {
3737
return vec[$node];
3838
}
39-
if ($context instanceof namespace\RenderContext) {
39+
if ($context is namespace\RenderContext) {
4040
if ($context->getOutputFormat() !== OutputFormat::HTML) {
4141
return vec[$node];
4242
}
@@ -65,10 +65,6 @@ final class SyntaxHighlightingFilter extends Markdown\RenderFilter {
6565

6666
/** Convert an HHAST FFP AST node into an HTML string. */
6767
protected static function getHTML(HHAST\Node $node): string {
68-
if ($node instanceof HHAST\Missing) {
69-
return '';
70-
}
71-
7268
if ($node->isTrivia() || $node->isToken()) {
7369
$inner = \htmlspecialchars($node->getCode());
7470
} else {
@@ -77,7 +73,7 @@ final class SyntaxHighlightingFilter extends Markdown\RenderFilter {
7773
|> Str\join($$, '');
7874
}
7975

80-
if ($node instanceof HHAST\NodeList ) {
76+
if ($node is HHAST\NodeList<_> ) {
8177
return $inner;
8278
}
8379

src/PageSections/FunctionishParameters.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class FunctionishParameters extends PageSection {
2121
<<__Override>>
2222
public function getMarkdown(): ?string {
2323
$f = $this->definition;
24-
if (!$f instanceof ScannedFunctionish) {
24+
if (!$f is ScannedFunctionish) {
2525
return null;
2626
}
2727

src/PageSections/FunctionishReturnValues.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ final class FunctionishReturnValues extends PageSection {
1919
<<__Override>>
2020
public function getMarkdown(): ?string {
2121
$f = $this->definition;
22-
if (!$f instanceof ScannedFunctionish) {
22+
if (!$f is ScannedFunctionish) {
2323
return null;
2424
}
2525

src/PageSections/FunctionishSignature.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ final class FunctionishSignature extends PageSection {
1616
<<__Override>>
1717
public function getMarkdown(): ?string {
1818
$f = $this->definition;
19-
if (!$f instanceof ScannedFunctionish) {
19+
if (!$f is ScannedFunctionish) {
2020
return null;
2121
}
2222

src/PageSections/InterfaceSynopsis.hack

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class InterfaceSynopsis extends PageSection {
2424
<<__Override>>
2525
public function getMarkdown(): ?string {
2626
$c = $this->definition;
27-
if (!$c instanceof ScannedClassish) {
27+
if (!$c is ScannedClassish) {
2828
return null;
2929
}
3030

@@ -104,13 +104,13 @@ final class InterfaceSynopsis extends PageSection {
104104
ScannedMethod $m,
105105
): ?string {
106106
$pp = $this->context->getPathProvider();
107-
if ($c instanceof ScannedClass) {
107+
if ($c is ScannedClass) {
108108
return $pp->getPathForClassMethod($c->getName(), $m->getName());
109109
}
110-
if ($c instanceof ScannedInterface) {
110+
if ($c is ScannedInterface) {
111111
return $pp->getPathForInterfaceMethod($c->getName(), $m->getName());
112112
}
113-
if ($c instanceof ScannedTrait) {
113+
if ($c is ScannedTrait) {
114114
return $pp->getPathForTraitMethod($c->getName(), $m->getName());
115115
}
116116
invariant_violation("Don't know how to handle type %s", \get_class($c));
@@ -131,11 +131,11 @@ final class InterfaceSynopsis extends PageSection {
131131
$ret .= 'final ';
132132
}
133133

134-
if ($c instanceof ScannedClass) {
134+
if ($c is ScannedClass) {
135135
$ret .= 'class ';
136-
} else if ($c instanceof ScannedInterface) {
136+
} else if ($c is ScannedInterface) {
137137
$ret .= 'interface ';
138-
} else if ($c instanceof ScannedTrait) {
138+
} else if ($c is ScannedTrait) {
139139
$ret .= 'trait ';
140140
} else {
141141
invariant_violation("Don't know what a %s is.", \get_class($c));

src/PageSections/NameHeading.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class NameHeading extends PageSection {
2323
$def = $this->definition;
2424
$md .= $def->getName();
2525

26-
if ($def instanceof ScannedFunctionish) {
26+
if ($def is ScannedFunctionish) {
2727
$md .= '()';
2828
}
2929

src/PageSections/ShapeFields.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ final class ShapeFields extends PageSection {
1919
public function getMarkdown(): ?string {
2020
$t = $this->definition;
2121
// Intentionally not documenting opaque type aliases
22-
if (!$t instanceof ScannedType) {
22+
if (!$t is ScannedType) {
2323
return null;
2424
}
2525
$t = $t->getAliasedType();

0 commit comments

Comments
 (0)