From 054039bdd09c41753805d4d6982d774329d2cc82 Mon Sep 17 00:00:00 2001 From: Fred Emmott Date: Wed, 17 Jul 2019 09:26:37 -0700 Subject: [PATCH] instanceof -> is, require 4.13 --- .travis.yml | 2 +- composer.json | 4 ++-- src/privateimpl/ClassFacts.hack | 2 +- src/privateimpl/ControllerFacts.hack | 2 +- src/uriparameters/spec/EnumParameterCodegenSpec.hack | 2 +- tests/RouterCodegenBuilderTest.hack | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index fcc4e3a..983f463 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ sudo: required language: generic services: docker env: -- HHVM_VERSION=4.6-latest +- HHVM_VERSION=4.13-latest - HHVM_VERSION=latest - HHVM_VERSION=nightly install: diff --git a/composer.json b/composer.json index 5c96e1b..3ff2ee7 100644 --- a/composer.json +++ b/composer.json @@ -4,8 +4,8 @@ "keywords": ["hack", "router", "routing", "hhvm"], "homepage": "https://github.com/hhvm/hack-router-codegen", "require": { - "hhvm": "^4.6", - "facebook/hack-router": "^0.18", + "hhvm": "^4.13", + "facebook/hack-router": "^0.19", "facebook/hack-http-request-response-interfaces": "^0.2", "facebook/hack-codegen": "^4.1.0", "facebook/definition-finder": "^2.7", diff --git a/src/privateimpl/ClassFacts.hack b/src/privateimpl/ClassFacts.hack index feb3320..6dbb54d 100644 --- a/src/privateimpl/ClassFacts.hack +++ b/src/privateimpl/ClassFacts.hack @@ -36,7 +36,7 @@ final class ClassFacts { ): ImmMap, ScannedClass> { $mappable = Map { }; foreach ($this->classes as $class) { - if (!$class instanceof ScannedClass) { + if (!$class is ScannedClass) { continue; } $name = $this->asClassname($wanted, $class->getName()); diff --git a/src/privateimpl/ControllerFacts.hack b/src/privateimpl/ControllerFacts.hack index 03efacf..15c8cc6 100644 --- a/src/privateimpl/ControllerFacts.hack +++ b/src/privateimpl/ControllerFacts.hack @@ -42,7 +42,7 @@ final class ControllerFacts { private function isUriMappable( ScannedClassish $class ): bool { - if (!$class instanceof ScannedClass) { + if (!$class is ScannedClass) { return false; } if ($class->isAbstract()) { diff --git a/src/uriparameters/spec/EnumParameterCodegenSpec.hack b/src/uriparameters/spec/EnumParameterCodegenSpec.hack index fb3860c..9f8eda0 100644 --- a/src/uriparameters/spec/EnumParameterCodegenSpec.hack +++ b/src/uriparameters/spec/EnumParameterCodegenSpec.hack @@ -16,7 +16,7 @@ final class EnumParameterCodegenSpec extends UriParameterCodegenSpec { RequestParameter $param, ): EnumRequestParameter { invariant( - $param instanceof EnumRequestParameter, + $param is EnumRequestParameter<_>, 'Expected %s to be an enum parameter, got %s', $param->getName(), \get_class($param), diff --git a/tests/RouterCodegenBuilderTest.hack b/tests/RouterCodegenBuilderTest.hack index a887336..6951ba7 100644 --- a/tests/RouterCodegenBuilderTest.hack +++ b/tests/RouterCodegenBuilderTest.hack @@ -65,7 +65,7 @@ final class RouterCodegenBuilderTest extends BaseCodegenTestCase { self::CODEGEN_NS, 'MySiteRouter', ); - assert($class instanceof \Facebook\HackCodegen\CodegenFile); + assert($class is \Facebook\HackCodegen\CodegenFile); return $class->render(); }