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

Commit

Permalink
Support HHVM 3.24, require HHVM 3.23
Browse files Browse the repository at this point in the history
  • Loading branch information
fredemmott committed Jan 5, 2018
1 parent 4f381eb commit 20aa3b3
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .hhconfig
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
assume_php=false
enable_experimental_tc_features = safe_pass_by_ref, safe_array, safe_vector_array, contextual_inference
ignored_paths = [ "vendor/.+/tests/.+" ]
15 changes: 4 additions & 11 deletions .travis.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/sh
set -ex
hhvm --version
apt-get update -y
apt-get install -y wget curl git
curl https://getcomposer.org/installer | hhvm -d hhvm.jit=0 --php -- /dev/stdin --install-dir=/usr/local/bin --filename=composer

cd /var/source
Expand All @@ -14,13 +12,8 @@ bin/hh-autoload
hh_server --check $(pwd)
hhvm -d hhvm.jit=0 vendor/bin/phpunit \
--bootstrap=vendor/hh_autoload.php tests/
hhvm -d hhvm.jit=0 -d hhvm.php7.all=1 vendor/bin/phpunit \
--bootstrap=vendor/hh_autoload.php tests/

HHVM_VERSION=$(hhvm --php -r 'echo HHVM_VERSION_ID;' 2>/dev/null);
if [ $HHVM_VERSION -ge 32002 ]; then
hhvm -d hhvm.php7.all=1 -d hhvm.jit=0 vendor/bin/phpunit tests/
fi

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)
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ language: generic
services:
- docker
env:
- HHVM_VERSION=3.18-lts-latest
- HHVM_VERSION=3.21-lts-latest
- HHVM_VERSION=latest
- HHVM_VERSION=nightly
install:
Expand Down
4 changes: 2 additions & 2 deletions src/HHClientFallbackHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function getCache(): ?self::TCache{
$key = __CLASS__.'!cache';
if (\apc_exists($key)) {
$success = false;
$data = \apc_fetch($key, $success);
$data = \apc_fetch($key, &$success);
if (!$success) {
return null;
}
Expand Down Expand Up @@ -194,7 +194,7 @@ private function lookupPathImpl(string $kind, string $name): ?string {

$exit_code = null;
$output = array();
$last = \exec($cmd, $output, $exit_code);
$last = \exec($cmd, &$output, &$exit_code);
if ($exit_code !== 0) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/RootImporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function testImportTree(

$output = [];
$exit_code = null;
$result = exec($cmd, $output, $exit_code);
$result = exec($cmd, &$output, &$exit_code);

$contents = file_get_contents($tempfile);
unlink($tempfile);
Expand Down
4 changes: 2 additions & 2 deletions tests/ScannerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ public function testParsersMatch(): void {
$expected = $def_finder[$type];
/* HH_IGNORE_ERROR[4051] */
$actual = $fact_parse[$type];
ksort($expected);
ksort($actual);
ksort(&$expected);
ksort(&$actual);
$this->assertEquals(
array_filter($expected, $path ==> strpos($path, '/test') === false),
array_filter($actual, $path ==> strpos($path, '/test') === false),
Expand Down

0 comments on commit 20aa3b3

Please sign in to comment.