diff --git a/.hhconfig b/.hhconfig index 0c2153c..3d59636 100644 --- a/.hhconfig +++ b/.hhconfig @@ -1 +1,2 @@ assume_php=false +enable_experimental_tc_features = safe_pass_by_ref, safe_array, safe_vector_array, contextual_inference diff --git a/.travis.sh b/.travis.sh index 01f5c66..a5bd904 100755 --- a/.travis.sh +++ b/.travis.sh @@ -11,8 +11,5 @@ hh_server --check $(pwd) hhvm -d hhvm.php7.all=0 vendor/bin/phpunit tests/ hhvm -d hhvm.php7.all=1 vendor/bin/phpunit tests/ -HHVM_VERSION=$(hhvm --php -r 'echo HHVM_VERSION_ID;' 2>/dev/null); -if [ $HHVM_VERSION -ge 32200 -a $HHVM_VERSION -lt 32300 ]; then - echo enable_experimental_tc_features = optional_shape_field, unknown_fields_shape_is_not_subtype_of_known_fields_shape >> .hhconfig - hh_server --check $(pwd) -fi +sed -i '/enable_experimental_tc_features/d' .hhconfig +hh_server --check $(pwd) diff --git a/.travis.yml b/.travis.yml index 610db6f..c662f6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ language: generic services: - docker env: - - HHVM_VERSION=3.21-lts-latest - HHVM_VERSION=latest - HHVM_VERSION=nightly install: diff --git a/composer.json b/composer.json index ec36309..7278836 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,7 @@ "keywords": ["hack", "router", "routing", "hhvm"], "homepage": "https://github.com/hhvm/hack-router", "require": { + "hhvm": "^3.23.0", "hack-psr/psr7-http-message-hhi": "^0.2.0|^1.0.0", "hhvm/hsl": "^1.0.0", "hhvm/hhvm-autoload": "^1.5.3" @@ -17,6 +18,6 @@ "phpunit/phpunit": "^5.1", "91carriage/phpunit-hhi": "^5.1", "zendframework/zend-diactoros": "^1.3", - "facebook/fbexpect": "^0.3.0" + "facebook/fbexpect": "^0.4.0" } } diff --git a/composer.lock b/composer.lock index 63d72ce..7219372 100644 --- a/composer.lock +++ b/composer.lock @@ -4,24 +4,24 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "71720f557a6fcd3dc35eeffad187a014", + "content-hash": "6e5c7426697148c0a6101682db652352", "packages": [ { "name": "facebook/definition-finder", - "version": "v1.6.3", + "version": "v1.6.4", "source": { "type": "git", "url": "https://github.com/hhvm/definition-finder.git", - "reference": "38f37b3eafec26fd5030c0f9f3584fc6493c9a9b" + "reference": "e39f5e2a6e3636e5a8cdb1670188c5c728b13470" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hhvm/definition-finder/zipball/38f37b3eafec26fd5030c0f9f3584fc6493c9a9b", - "reference": "38f37b3eafec26fd5030c0f9f3584fc6493c9a9b", + "url": "https://api.github.com/repos/hhvm/definition-finder/zipball/e39f5e2a6e3636e5a8cdb1670188c5c728b13470", + "reference": "e39f5e2a6e3636e5a8cdb1670188c5c728b13470", "shasum": "" }, "require": { - "hhvm": "~3.12" + "hhvm": "~3.23" }, "require-dev": { "91carriage/phpunit-hhi": "~5.1", @@ -46,7 +46,7 @@ "hack", "hhvm" ], - "time": "2017-10-10T23:29:38+00:00" + "time": "2018-01-05T20:56:28+00:00" }, { "name": "fredemmott/hack-error-suppressor", @@ -122,23 +122,23 @@ }, { "name": "hhvm/hhvm-autoload", - "version": "v1.5.3", + "version": "v1.5.4", "source": { "type": "git", "url": "https://github.com/hhvm/hhvm-autoload.git", - "reference": "e91e24c69118505999e6f7e9e051b03c85f634b4" + "reference": "20aa3b34de71a337644a146f2abbafe491fd3bb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hhvm/hhvm-autoload/zipball/e91e24c69118505999e6f7e9e051b03c85f634b4", - "reference": "e91e24c69118505999e6f7e9e051b03c85f634b4", + "url": "https://api.github.com/repos/hhvm/hhvm-autoload/zipball/20aa3b34de71a337644a146f2abbafe491fd3bb2", + "reference": "20aa3b34de71a337644a146f2abbafe491fd3bb2", "shasum": "" }, "require": { "composer-plugin-api": "^1.0", - "facebook/definition-finder": "^1.0", + "facebook/definition-finder": "~1.6.4", "fredemmott/hack-error-suppressor": "^1.0", - "hhvm": "^3.12" + "hhvm": "^3.23" }, "replace": { "facebook/hhvm-autoload": "1.*" @@ -168,20 +168,20 @@ ] }, "notification-url": "https://packagist.org/downloads/", - "time": "2017-10-20T01:23:28+00:00" + "time": "2018-01-05T21:10:38+00:00" }, { "name": "hhvm/hsl", - "version": "v1.0.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/hhvm/hsl.git", - "reference": "99ed4bce2170d12e38654f8502482fcac5b80352" + "reference": "ef61c015ab5969d10c2b0d66cfbc1dd20b13ec17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hhvm/hsl/zipball/99ed4bce2170d12e38654f8502482fcac5b80352", - "reference": "99ed4bce2170d12e38654f8502482fcac5b80352", + "url": "https://api.github.com/repos/hhvm/hsl/zipball/ef61c015ab5969d10c2b0d66cfbc1dd20b13ec17", + "reference": "ef61c015ab5969d10c2b0d66cfbc1dd20b13ec17", "shasum": "" }, "require": { @@ -190,14 +190,14 @@ "require-dev": { "91carriage/phpunit-hhi": "^5.7", "facebook/definition-finder": "^1.6.1", - "facebook/fbexpect": "^0.2", - "hhvm": "^3.21.3", + "facebook/fbexpect": "^0.4", + "hhvm": "^3.23.2", "phpunit/phpunit": "^5.7" }, "type": "library", "notification-url": "https://packagist.org/downloads/", "description": "The Hack Standard Library", - "time": "2017-10-26T18:38:35+00:00" + "time": "2018-01-05T23:38:40+00:00" }, { "name": "psr/http-message", @@ -253,14 +253,14 @@ "packages-dev": [ { "name": "91carriage/phpunit-hhi", - "version": "5.7.1", + "version": "5.7.2", "source": { "type": "git", "url": "https://git.simon.geek.nz/91-carriage/phpunit-hhi.git", - "reference": "6864897f023f111d8b72fb7340c1ef5d0d9f8a45" + "reference": "b2ca7d221fa4ac6b4331e0dbc32cdc918ab8b11f" }, "require": { - "hhvm": ">=3.12.0" + "hhvm": ">=3.23.0" }, "conflict": { "phpunit/phpunit": "<5.7.15" @@ -298,7 +298,7 @@ "phpunit", "testing" ], - "time": "2017-04-09T02:42:01+00:00" + "time": "2018-01-09T08:14:01+00:00" }, { "name": "doctrine/instantiator", @@ -356,20 +356,21 @@ }, { "name": "facebook/fbexpect", - "version": "v0.3", + "version": "v0.4", "source": { "type": "git", "url": "https://github.com/hhvm/fbexpect.git", - "reference": "d650f97d7da0b7bbaf7a3641feca4cdb41414dce" + "reference": "21e8ea201df6555bcf014a75560426650c7d961b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hhvm/fbexpect/zipball/d650f97d7da0b7bbaf7a3641feca4cdb41414dce", - "reference": "d650f97d7da0b7bbaf7a3641feca4cdb41414dce", + "url": "https://api.github.com/repos/hhvm/fbexpect/zipball/21e8ea201df6555bcf014a75560426650c7d961b", + "reference": "21e8ea201df6555bcf014a75560426650c7d961b", "shasum": "" }, "require": { "91carriage/phpunit-hhi": "^5.7", + "hhvm": "^3.23", "phpunit/phpunit": "^5.7" }, "type": "library", @@ -384,7 +385,7 @@ }, "notification-url": "https://packagist.org/downloads/", "description": "Unit test helpers for Facebook projects", - "time": "2017-09-20T18:27:43+00:00" + "time": "2018-01-05T21:25:50+00:00" }, { "name": "myclabs/deep-copy", @@ -487,22 +488,22 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.2.2", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", - "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.3.0", + "php": "^5.6 || ^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -528,20 +529,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-08T06:39:58+00:00" + "time": "2017-11-10T14:09:06+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.3.0", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", - "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { @@ -575,20 +576,20 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-06-03T08:32:36+00:00" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.7.2", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", - "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", "shasum": "" }, "require": { @@ -600,7 +601,7 @@ }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7" }, "type": "library", "extra": { @@ -638,7 +639,7 @@ "spy", "stub" ], - "time": "2017-09-04T11:05:03+00:00" + "time": "2017-11-24T13:59:53+00:00" }, { "name": "phpunit/php-code-coverage", @@ -705,16 +706,16 @@ }, { "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -748,7 +749,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -842,16 +843,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.11", + "version": "1.4.12", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", "shasum": "" }, "require": { @@ -887,20 +888,20 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27T10:12:30+00:00" + "time": "2017-12-04T08:55:13+00:00" }, { "name": "phpunit/phpunit", - "version": "5.7.23", + "version": "5.7.26", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "78532d5269d984660080d8e0f4c99c5c2ea65ffe" + "reference": "7fbc25c13309de0c4c9bb48b7361f1eca34c7fbd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/78532d5269d984660080d8e0f4c99c5c2ea65ffe", - "reference": "78532d5269d984660080d8e0f4c99c5c2ea65ffe", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7fbc25c13309de0c4c9bb48b7361f1eca34c7fbd", + "reference": "7fbc25c13309de0c4c9bb48b7361f1eca34c7fbd", "shasum": "" }, "require": { @@ -925,7 +926,7 @@ "sebastian/object-enumerator": "~2.0", "sebastian/resource-operations": "~1.0", "sebastian/version": "~1.0.3|~2.0", - "symfony/yaml": "~2.1|~3.0" + "symfony/yaml": "~2.1|~3.0|~4.0" }, "conflict": { "phpdocumentor/reflection-docblock": "3.0.2" @@ -969,7 +970,7 @@ "testing", "xunit" ], - "time": "2017-10-15T06:13:55+00:00" + "time": "2017-12-17T06:14:38+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -1545,23 +1546,26 @@ }, { "name": "symfony/yaml", - "version": "v3.3.10", + "version": "v3.4.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46" + "reference": "25c192f25721a74084272671f658797d9e0e0146" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", - "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", + "url": "https://api.github.com/repos/symfony/yaml/zipball/25c192f25721a74084272671f658797d9e0e0146", + "reference": "25c192f25721a74084272671f658797d9e0e0146", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8" }, + "conflict": { + "symfony/console": "<3.4" + }, "require-dev": { - "symfony/console": "~2.8|~3.0" + "symfony/console": "~3.4|~4.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -1569,7 +1573,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1596,7 +1600,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-10-05T14:43:42+00:00" + "time": "2018-01-03T07:37:34+00:00" }, { "name": "webmozart/assert", @@ -1650,16 +1654,16 @@ }, { "name": "zendframework/zend-diactoros", - "version": "1.6.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-diactoros.git", - "reference": "c8664b92a6d5bc229e48b0923486c097e45a7877" + "reference": "ed6ce7e2105c400ca10277643a8327957c0384b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/c8664b92a6d5bc229e48b0923486c097e45a7877", - "reference": "c8664b92a6d5bc229e48b0923486c097e45a7877", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/ed6ce7e2105c400ca10277643a8327957c0384b7", + "reference": "ed6ce7e2105c400ca10277643a8327957c0384b7", "shasum": "" }, "require": { @@ -1678,8 +1682,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev", - "dev-develop": "1.7-dev" + "dev-master": "1.7.x-dev", + "dev-develop": "1.8.x-dev" } }, "autoload": { @@ -1698,7 +1702,7 @@ "psr", "psr-7" ], - "time": "2017-10-12T15:24:51+00:00" + "time": "2018-01-04T18:21:48+00:00" } ], "aliases": [], @@ -1706,6 +1710,8 @@ "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, - "platform": [], + "platform": { + "hhvm": "^3.23.0" + }, "platform-dev": [] } diff --git a/src/router/PrefixMatchingResolver.php b/src/router/PrefixMatchingResolver.php index 7e7f8f1..26ff70c 100644 --- a/src/router/PrefixMatchingResolver.php +++ b/src/router/PrefixMatchingResolver.php @@ -66,7 +66,7 @@ private function resolveWithMap( $pattern = '#^'.$regexp.'#'; $matches = []; - if (preg_match($pattern, $path, $matches) !== 1) { + if (preg_match($pattern, $path, &$matches) !== 1) { continue; } $matched = $matches[0]; diff --git a/src/router/SimpleRegexpResolver.php b/src/router/SimpleRegexpResolver.php index 9405bd2..dab0560 100644 --- a/src/router/SimpleRegexpResolver.php +++ b/src/router/SimpleRegexpResolver.php @@ -35,7 +35,7 @@ public function resolve( $map = $this->map[$method]; foreach ($map as $regexp => $responder) { $matches = []; - if (preg_match($regexp, $path, $matches) !== 1) { + if (preg_match($regexp, $path, &$matches) !== 1) { continue; } $ret =