Skip to content

Commit 876d323

Browse files
authored
Merge pull request #25 from nazg-hack/fixed/hhvm3.26-unbound-name-patch
Fixed/hhvm3.26 unbound name patch
2 parents 1f65289 + 5340d52 commit 876d323

19 files changed

+49
-69
lines changed

.travis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ curl https://getcomposer.org/installer | hhvm -d hhvm.jit=0 --php -- /dev/stdin
55

66
cd /var/source
77
hhvm -d hhvm.php7.all=1 -d hhvm.jit=0 -d hhvm.hack.lang.auto_typecheck=0 /usr/local/bin/composer install
8-
8+
hh_client
99
hhvm -d hhvm.php7.all=1 -d hhvm.jit=0 -d hhvm.hack.lang.auto_typecheck=0 vendor/bin/phpunit

.travis.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
language: php
21
sudo: required
3-
dist: trusty
4-
php:
5-
- hhvm
6-
2+
language: generic
73
services:
8-
- memcached
9-
- redis
10-
11-
install: composer install
12-
4+
- docker
5+
env:
6+
matrix:
7+
- HHVM_VERSION=3.25.3
8+
- HHVM_VERSION=3.26.0
9+
- HHVM_VERSION=latest
10+
install:
11+
- docker pull hhvm/hhvm:$HHVM_VERSION
1312
script:
14-
- hh_client
15-
- hhvm -d hhvm.php7.all=1 -d hhvm.jit=0 -d hhvm.hack.lang.auto_typecheck=0 vendor/bin/phpunit
13+
- env | egrep '^(HHVM_VERSION|GITHUB_API_KEY|TRAVIS_EVENT_TYPE)=' > ./env-list
14+
- docker run --env-file ./env-list -v $(pwd):/var/source hhvm/hhvm:$HHVM_VERSION /var/source/.travis.sh

composer.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@
2323
"php": ">=7.0",
2424
"hhvm": ">=3.25.0",
2525
"ext-asio": "*",
26-
"hhvm/hhvm-autoload": "^1.5",
27-
"hhvm/hsl": "^1.0.0",
28-
"hhvm/type-assert": "^3.2.0",
26+
"hhvm/hhvm-autoload": "^1.6",
27+
"hhvm/type-assert": "^3.2.1",
2928
"hack-psr/psr7-http-message-hhi": "^1.0.0",
30-
"ytake/hh-container": "^0.5",
31-
"ytake/hh-config-aggregator": "^0.1.1",
32-
"nazg/heredity": "^0.3.0",
33-
"nazg/hcache": "^0.1.0",
29+
"ytake/hh-container": "^0.5.2",
30+
"ytake/hh-config-aggregator": "^0.1.5",
31+
"nazg/heredity": "^0.3.2",
32+
"nazg/hcache": "^0.1.2",
3433
"facebook/hack-router": "^0.13",
3534
"zendframework/zend-diactoros": "^1.7.0",
3635
"monolog/monolog": "^1.23.0",
@@ -42,7 +41,7 @@
4241
"phpunit/phpunit": "^5.7",
4342
"91carriage/phpunit-hhi": "^5.7",
4443
"facebook/fbexpect": "^0.4.0",
45-
"hhvm/hhast": "^1.0.0"
44+
"hhvm/hhast": "^1.0.1"
4645
},
4746
"autoload": {
4847
"psr-4": {

src/Cache/CacheConfiguration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,22 @@ public function __construct(
5757
) {}
5858

5959
public function getMemcached(): ?Memcached {
60-
if(!is_null($this->memcachedConfig)) {
60+
if(!\is_null($this->memcachedConfig)) {
6161
$resolver = new MemcachedResolver($this->memcachedConfig);
6262
return $resolver->provide();
6363
}
6464
return null;
6565
}
6666

6767
public function getFileSystemDir(): ?string {
68-
if(!is_null($this->filesystemConfig)) {
68+
if(!\is_null($this->filesystemConfig)) {
6969
return Shapes::idx($this->filesystemConfig, 'cacheStoreDir');
7070
}
7171
return null;
7272
}
7373

7474
public function getRedis(): ?Redis {
75-
if(!is_null($this->redisConfig)) {
75+
if(!\is_null($this->redisConfig)) {
7676
$resolver = new RedisResolver($this->redisConfig);
7777
return $resolver->provide();
7878
}

src/Cache/CacheServiceModule.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,23 @@ protected function detectCacheProvider(
7373
if($this->defaultDriver === Driver::File) {
7474
if($provider instanceof FileSystemCache) {
7575
$dir = $cacheConfigure->getFileSystemDir();
76-
if(!is_null($dir)) {
76+
if(!\is_null($dir)) {
7777
$provider->setDirectory($dir);
7878
}
7979
}
8080
}
8181
if($this->defaultDriver === Driver::Memcached) {
8282
if($provider instanceof MemcachedCache) {
8383
$m = $cacheConfigure->getMemcached();
84-
if(!is_null($m)) {
84+
if(!\is_null($m)) {
8585
$provider->setMemcached($m);
8686
}
8787
}
8888
}
8989
if($this->defaultDriver === Driver::Redis) {
9090
if($provider instanceof RedisCache) {
9191
$r = $cacheConfigure->getRedis();
92-
if(!is_null($r)) {
92+
if(!\is_null($r)) {
9393
$provider->setRedis($r);
9494
}
9595
}

src/Cache/Resolver/MemcachedResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function provide(): this::T {
3232
$config = $this->config;
3333
$m = new Memcached(Shapes::idx($config, 'persistentId'));
3434
$servers = Shapes::idx($config, 'servers');
35-
if(!is_null($servers)) {
35+
if(!\is_null($servers)) {
3636
$m->addServers($servers->toArray());
3737
}
3838
return $m;

src/Cache/Resolver/RedisResolver.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,26 @@ public function provide(): this::T {
4646
);
4747
return $redis;
4848
};
49-
$redis = call_user_func_array($r, [$redis, $config]);
49+
$redis = \call_user_func_array($r, [$redis, $config]);
5050
$this->redisConnectOption($redis, $config);
5151
return $redis;
5252
}
5353

5454
protected function redisConnectOption(Redis $redis, RedisConfig $config): void {
5555
$password = Shapes::idx($config, 'password', null);
56-
if ($password) {
56+
if (!\is_null($password)) {
5757
$redis->auth($password);
5858
}
5959
$database = Shapes::idx($config, 'database', null);
60-
if ($database) {
60+
if (!\is_null($database)) {
6161
$redis->select($database);
6262
}
6363
$prefix = Shapes::idx($config, 'prefix', null);
64-
if ($prefix) {
64+
if (!\is_null($prefix)) {
6565
$redis->setOption(Redis::OPT_PREFIX, $prefix);
6666
}
6767
$timeout = Shapes::idx($config, 'readTimeout', null);
68-
if ($timeout) {
68+
if (!\is_null($timeout)) {
6969
$redis->setOption(Redis::OPT_READ_TIMEOUT, $timeout);
7070
}
7171
}

src/Foundation/Application.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function run(ServerRequestInterface $serverRequest): void {
5252
invariant(
5353
$router instanceof BaseRouter,
5454
"%s class must extend %s",
55-
get_class($router),
55+
\get_class($router),
5656
BaseRouter::class,
5757
);
5858
list($middleware, $attributes) =
@@ -127,8 +127,8 @@ protected function middleware(): ImmVector<\Nazg\Types\TMiddlewareClass> {
127127
}
128128

129129
private function registerDependencies(mixed $config): void {
130-
if (is_array($config)) {
131-
if (array_key_exists(Service::MODULES, $config)) {
130+
if (\is_array($config)) {
131+
if (\array_key_exists(Service::MODULES, $config)) {
132132
if ($this->dependency instanceof \Nazg\Foundation\Dependency\Dependency) {
133133
$vModule = $config[Service::MODULES];
134134
if ($vModule instanceof ImmVector) {
@@ -140,8 +140,8 @@ private function registerDependencies(mixed $config): void {
140140
}
141141

142142
private function registerMiddlewares(mixed $config): void {
143-
if (is_array($config)) {
144-
if (array_key_exists(Service::MIDDLEWARES, $config)) {
143+
if (\is_array($config)) {
144+
if (\array_key_exists(Service::MIDDLEWARES, $config)) {
145145
if ($config[Service::MIDDLEWARES] instanceof ImmVector) {
146146
$this->im = $config[Service::MIDDLEWARES];
147147
}

src/Foundation/Exception/ExceptionHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@ protected function respond(ExceptionImmMap $em, \Throwable $e): void {
4747
}
4848

4949
public function handleException(\Throwable $e): void {
50-
call_user_func_array([$this, 'respond'], [$this->toImmMap($e), $e]);
50+
\call_user_func_array([$this, 'respond'], [$this->toImmMap($e), $e]);
5151
}
5252

5353
protected function toImmMap(\Throwable $e): ExceptionImmMap {
5454
return new ImmMap(
5555
[
5656
'message' => $e->getMessage(),
57-
'exception' => get_class($e),
57+
'exception' => \get_class($e),
5858
'file' => $e->getFile(),
5959
'line' => $e->getLine(),
6060
'trace' => map(
6161
$e->getTrace(),
6262
$v ==> {
63-
if(is_array($v)) {
63+
if(\is_array($v)) {
6464
return (new Map($v))->removeKey('args')->toArray();
6565
}
6666
return [];

src/Foundation/Exception/ExceptionRegister.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ class ExceptionRegister implements BootstrapRegisterInterface {
2525
public function __construct(protected ExceptionHandleInterface $handler) {}
2626

2727
public function register(): void {
28-
set_exception_handler([$this->handler, 'handleException']);
28+
\set_exception_handler([$this->handler, 'handleException']);
2929
}
3030
}

0 commit comments

Comments
 (0)