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

Commit bb06b9b

Browse files
committed
instanceof -> is
1 parent a3cef48 commit bb06b9b

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
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.1-latest
5+
- HHVM_VERSION=4.13-latest
66
- HHVM_VERSION=latest
77
- HHVM_VERSION=nightly
88
install:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Hack Codegen is a library for programatically generating Hack code",
44
"keywords": ["code generation", "Hack"],
55
"require": {
6-
"hhvm": "^4.1.0",
6+
"hhvm": "^4.13.0",
77
"hhvm/hhvm-autoload": "^2.0",
88
"hhvm/hsl": "^4.0"
99
},

src/CodegenFunctionish.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ abstract class CodegenFunctionish implements ICodeBuilderRenderer {
191191

192192
protected function getMaxCodeLength(): int {
193193
$max_length = $this->config->getMaxLineLength();
194-
if ($this instanceof CodegenMethodish) {
194+
if ($this is CodegenMethodish) {
195195
$max_length -= $this->config->getSpacesPerIndentation();
196196
}
197197
return $max_length;

src/CodegenMethodish.hack

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ abstract class CodegenMethodish extends CodegenFunctionish
5050

5151
public function setContainingClass(CodegenClassish $class): this {
5252
$this->containingClass = $class;
53-
if ($this->containingClass instanceof CodegenInterface) {
53+
if ($this->containingClass is CodegenInterface) {
5454
$this->isAbstract = true;
5555
}
5656
return $this;
@@ -63,7 +63,7 @@ abstract class CodegenMethodish extends CodegenFunctionish
6363
->addIf($this->isFinal && !$this->isAbstract, 'final ')
6464
->addIf(
6565
$this->isAbstract &&
66-
!($this->containingClass instanceof CodegenInterface),
66+
!($this->containingClass is CodegenInterface),
6767
'abstract ',
6868
)
6969
->add($this->getVisibility().' ')

src/CodegenShapeMember.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
}
3838

3939
public function getType(): string {
40-
if ($this->type instanceof ICodeBuilderRenderer) {
40+
if ($this->type is ICodeBuilderRenderer) {
4141
return $this->type->render();
4242
}
4343

src/key-value-render/HackBuilderShapeRenderer.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ final class HackBuilderShapeRenderer
4040
$key,
4141
);
4242
invariant(
43-
$value_renderer instanceof IHackBuilderValueRenderer,
43+
$value_renderer is IHackBuilderValueRenderer<_>,
4444
'Value renderer for key "%s" is of type "%s", which is not a %s',
4545
$key,
4646
\is_object($value_renderer)

0 commit comments

Comments
 (0)