diff --git a/.hhconfig b/.hhconfig index 5e3b4da..498623e 100644 --- a/.hhconfig +++ b/.hhconfig @@ -7,3 +7,4 @@ decl_override_require_hint=true enable_experimental_tc_features=shape_field_check,sealed_classes user_attributes= disable_primitive_refinement=true +disable_static_local_variables = true diff --git a/composer.lock b/composer.lock index c31ac96..8076e25 100644 --- a/composer.lock +++ b/composer.lock @@ -108,16 +108,16 @@ "packages-dev": [ { "name": "facebook/difflib", - "version": "v1.1", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/hhvm/difflib.git", - "reference": "195502ecd77a691e91449a3b726c9c670a99addf" + "reference": "545adb5da05d342dad1bc45b75f6fb95aab3de4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hhvm/difflib/zipball/195502ecd77a691e91449a3b726c9c670a99addf", - "reference": "195502ecd77a691e91449a3b726c9c670a99addf", + "url": "https://api.github.com/repos/hhvm/difflib/zipball/545adb5da05d342dad1bc45b75f6fb95aab3de4a", + "reference": "545adb5da05d342dad1bc45b75f6fb95aab3de4a", "shasum": "" }, "require": { @@ -139,7 +139,7 @@ "license": [ "MIT" ], - "time": "2019-02-09T01:44:39+00:00" + "time": "2019-03-22T23:29:07+00:00" }, { "name": "facebook/fbexpect", @@ -175,16 +175,16 @@ }, { "name": "facebook/hh-clilib", - "version": "v2.1.0", + "version": "v2.1.1", "source": { "type": "git", "url": "https://github.com/hhvm/hh-clilib.git", - "reference": "44f30c1f07b9d36430bfff721a119a0d43b15edd" + "reference": "9d6b1a8686951da24ab68ffeba25ae85d1788408" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hhvm/hh-clilib/zipball/44f30c1f07b9d36430bfff721a119a0d43b15edd", - "reference": "44f30c1f07b9d36430bfff721a119a0d43b15edd", + "url": "https://api.github.com/repos/hhvm/hh-clilib/zipball/9d6b1a8686951da24ab68ffeba25ae85d1788408", + "reference": "9d6b1a8686951da24ab68ffeba25ae85d1788408", "shasum": "" }, "require": { @@ -195,7 +195,7 @@ "require-dev": { "facebook/fbexpect": "^2.1.0", "hhvm/hacktest": "^1.0.0", - "hhvm/hhast": "^4.0" + "hhvm/hhast": "^4.0.2" }, "type": "library", "extra": { @@ -207,7 +207,7 @@ "license": [ "MIT" ], - "time": "2019-02-12T20:14:07+00:00" + "time": "2019-03-26T18:31:27+00:00" }, { "name": "hhvm/hacktest", @@ -296,16 +296,16 @@ }, { "name": "hhvm/hhvm-autoload", - "version": "v2.0.5", + "version": "v2.0.6", "source": { "type": "git", "url": "https://github.com/hhvm/hhvm-autoload.git", - "reference": "dbd50d7fb1856d1f6757e10bc30eb2bf5d17b3f1" + "reference": "4f510960e71adcad661c33ae355d0d9670d9c805" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hhvm/hhvm-autoload/zipball/dbd50d7fb1856d1f6757e10bc30eb2bf5d17b3f1", - "reference": "dbd50d7fb1856d1f6757e10bc30eb2bf5d17b3f1", + "url": "https://api.github.com/repos/hhvm/hhvm-autoload/zipball/4f510960e71adcad661c33ae355d0d9670d9c805", + "reference": "4f510960e71adcad661c33ae355d0d9670d9c805", "shasum": "" }, "require": { @@ -339,7 +339,7 @@ ] }, "notification-url": "https://packagist.org/downloads/", - "time": "2019-03-22T21:27:20+00:00" + "time": "2019-03-26T17:57:44+00:00" }, { "name": "hhvm/type-assert", diff --git a/src/router/BaseRouter.php b/src/router/BaseRouter.php index ed918e2..3ffe2bd 100644 --- a/src/router/BaseRouter.php +++ b/src/router/BaseRouter.php @@ -56,11 +56,11 @@ final public function routeRequest( return $this->routeMethodAndPath($method, $request->getUri()->getPath()); } + private ?IResolver $resolver = null; + protected function getResolver(): IResolver { - // Don't use <<__Memoize>> because that can be surprising with subclassing - static $resolver = null; - if ($resolver !== null) { - return $resolver; + if ($this->resolver !== null) { + return $this->resolver; } if (is_dev()) { @@ -84,6 +84,7 @@ protected function getResolver(): IResolver { \apc_store(__FILE__.'/cache', $routes); } } - return new PrefixMatchingResolver($routes); + $this->resolver = new PrefixMatchingResolver($routes); + return $this->resolver; } }