Skip to content

Commit 22d6db0

Browse files
committed
changed pipe
1 parent 9bf0f82 commit 22d6db0

File tree

11 files changed

+27
-30
lines changed

11 files changed

+27
-30
lines changed

composer.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@
2020
"hhvm/hsl": "^4.0",
2121
"hhvm/hsl-experimental": "^4.50",
2222
"hhvm/hhvm-autoload": "^3.0",
23-
"ytake/hungrr": "^0.12",
24-
"ytake/hhypermedia": "^0.6.0",
23+
"ytake/hungrr": "^0.13.2",
24+
"ytake/hhypermedia": "^0.6.1",
2525
"nazg/glue": "^1.5",
26-
"nazg/heredity": "^1.12",
27-
"nazg/hcache": "^0.6",
26+
"nazg/heredity": "^1.12.1",
27+
"nazg/hcache": "^0.6.1",
2828
"nazg/http-server-request-handler": "^0.6.0",
29-
"nazg/http-executor": "^0.12",
29+
"nazg/http-executor": "^0.12.1",
3030
"facebook/hack-router": "^0.19.6",
31+
"facebook/hh-clilib": "^2.5.0",
3132
"facebook/hack-http-request-response-interfaces": "^0.3",
32-
"hack-logging/hack-logging": "^0.7.0"
33+
"hack-logging/hack-logging": "^0.7.1"
3334
},
3435
"require-dev": {
3536
"facebook/fbexpect": "^2.6.1",

src/Foundation/Command/ApplicationCacheClear.hack

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ final class ApplicationCacheClear extends CliApplication {
2727
$stdout = $this->getStdout();
2828
if($cache->flushAll()) {
2929
await $stdout->writeAsync("Cache Clear");
30-
await $stdout->flushAsync();
3130
return 0;
3231
}
3332
await $stdout->writeAsync("[ERROR] Failed to clear cache.");
34-
await $stdout->flushAsync();
3533
return 1;
3634
}
3735

src/Foundation/Command/ContainerCacheClear.hack

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ final class ContainerCacheClear extends CliApplication {
2828
apc_delete($config->getContainerCacheKeyname());
2929
$stdout = $this->getStdout();
3030
await $stdout->writeAsync("Deleted Container Cache");
31-
await $stdout->flushAsync();
3231
return 0;
3332
}
3433

src/Logger/LoggerProvider.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class LoggerProvider implements ProviderInterface<Logger> {
3030
$config = $container->get(ApplicationConfig::class);
3131
$logConfig = $config->getLogConfig();
3232
return new Logger($logConfig['logname'], vec[
33-
new FilesystemHandler(File\open_write_only_nd($logConfig['logfile']))
33+
new FilesystemHandler(File\open_write_only($logConfig['logfile']))
3434
]);
3535
}
3636
}

tests/ApplicationTest.hack

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ use function Facebook\FBExpect\expect;
99
final class ApplicationTest extends HackTest {
1010

1111
public function testShouldReturnApplicationInstance(): void {
12-
list($read, $write) = IO\pipe_nd();
12+
list($read, $write) = IO\pipe();
1313
$container = new Container(new DependencyFactory());
1414
$app = new Foundation\Application($container, $read, $write);
1515
expect($app)->toBeInstanceOf(Foundation\Application::class);
1616
}
1717

1818
public function testShouldApplyApplication(): void {
19-
list($read, $write) = IO\pipe_nd();
19+
list($read, $write) = IO\pipe();
2020
$container = new Container(new DependencyFactory());
2121
$app = new Foundation\Application($container, $read, $write);
2222
$app->build(new Foundation\ApplicationConfig());
2323
expect($app)->toBeInstanceOf(Foundation\Application::class);
2424
}
2525

2626
public function testApplicationRunThrowException(): void {
27-
list($read, $write) = IO\pipe_nd();
27+
list($read, $write) = IO\pipe();
2828
$container = new Container(new DependencyFactory());
2929
$app = new Foundation\Application($container, $read, $write);
3030
$app->build(new Foundation\ApplicationConfig());
@@ -33,9 +33,9 @@ final class ApplicationTest extends HackTest {
3333
}
3434

3535
public async function testShouldReturnServerResponseCaseFoundRoute(): Awaitable<void> {
36-
list($read, $write) = IO\pipe_nd();
36+
list($read, $write) = IO\pipe();
3737
await $write->writeAsync(json_encode(dict[]));
38-
await $write->closeAsync();
38+
$write->close();
3939
$container = new Container(new DependencyFactory());
4040
$app = new Foundation\Application($container, $read, $write);
4141
$config = new Foundation\ApplicationConfig();

tests/Exception/ExceptionHandlerTest.hack

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class ExceptionHandlerTest extends HackTest {
1313

1414
public function testShouldReturnExceptionHandlerInterface(): void {
1515
$container = new Container(new DependencyFactory());
16-
list($read, $write) = IO\pipe_nd();
16+
list($read, $write) = IO\pipe();
1717
$container->bind(ExceptionHandleInterface::class)
1818
->provider(new ExceptionHandlerProvider($read, $write, new Emitter\SapiEmitter()));
1919
\HH\Asio\join($container->lockAsync());
@@ -22,7 +22,7 @@ final class ExceptionHandlerTest extends HackTest {
2222
}
2323

2424
public function testFunctionalExceptionRegister(): void {
25-
list($read, $write) = IO\pipe_nd();
25+
list($read, $write) = IO\pipe();
2626
$e = new ExceptionHandler($read, $write, new Emitter\SapiEmitter());
2727
$register = new ExceptionRegister($e);
2828
$register->register();
@@ -39,7 +39,7 @@ final class ExceptionHandlerTest extends HackTest {
3939
}
4040

4141
public function testFunctionalThrowNotFoundHttpException(): void {
42-
list($read, $write) = IO\pipe_nd();
42+
list($read, $write) = IO\pipe();
4343
$e = new ExceptionHandler($read, $write, new Emitter\SapiEmitter());
4444
$register = new ExceptionRegister($e);
4545
$register->register();

tests/Http/VndErrorResponseTest.hack

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,36 @@ use function Facebook\FBExpect\expect;
77
final class VndErrorResponseTest extends HackTest {
88

99
public async function testShouldBe(): Awaitable<void> {
10-
list($read, $write) = IO\pipe_nd();
10+
list($read, $write) = IO\pipe();
1111
$r = new VndErrorResponse($write);
1212
await $write->writeAsync(\json_encode(dict[]));
13-
await $write->closeAsync();
13+
$write->close();
1414
expect($r->getStatusCode())->toBeSame(500);
1515
expect($r->getProtocolVersion())->toBeSame('1.1');
1616
expect($r->getReasonPhrase())->toBeSame('Internal Server Error');
1717
expect($r->getHeaders())->toBeSame(dict[
1818
'content-type' => vec['application/vnd.error+json'],
1919
]);
20-
await $r->getBody()->flushAsync();
2120
$re = await $read->readAsync();
2221
expect($re)->toBeSame('{}');
2322
}
2423

2524
public async function testShouldReturnJsonBody(): Awaitable<void> {
26-
list($read, $write) = IO\pipe_nd();
25+
list($read, $write) = IO\pipe();
2726
await $write->writeAsync(\json_encode(dict[
2827
'testing' => dict[
2928
'HHVM' => 'Hack',
3029
]
3130
]));
32-
await $write->closeAsync();
31+
$write->close();
3332
$r = new VndErrorResponse($write, StatusCode::FORBIDDEN);
3433
expect($r->getStatusCode())->toBeSame(403);
3534
expect($r->getProtocolVersion())->toBeSame('1.1');
3635
expect($r->getReasonPhrase())->toBeSame('Forbidden');
3736
expect($r->getHeaders())->toBeSame(dict[
3837
'content-type' => vec['application/vnd.error+json'],
3938
]);
40-
await $r->getBody()->flushAsync();
39+
$r->getBody();
4140
$re = await $read->readAsync();
4241
expect($re)->toBeSame('{"testing":{"HHVM":"Hack"}}');
4342
}

tests/Middleware/LogExceptionMiddlewareTest.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class LogExceptionMiddlewareTest extends HackTest {
3030

3131
public function testShouldPutTestingLog(): void {
3232
$filename = __DIR__ . '/../storages/testing.log';
33-
list($read, $write) = IO\pipe_nd();
33+
list($read, $write) = IO\pipe();
3434
$heredity = new Middleware\Dispatcher(
3535
new AsyncMiddlewareStack(
3636
vec[

tests/Middleware/SimpleCorsMiddlewareTest.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class SimpleCorsMiddlewareTest extends HackTest {
2626

2727
public async function testShouldReturnCorsHeader(): Awaitable<void> {
2828
$filename = __DIR__ . '/../storages/testing.log';
29-
list($read, $write) = IO\pipe_nd();
29+
list($read, $write) = IO\pipe();
3030
$heredity = new Middleware\Dispatcher(
3131
new AsyncMiddlewareStack(
3232
vec[

tests/Routing/RouterTest.hack

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ final class RouterTest extends HackTest {
5858
}
5959

6060
public function testShouldDetectRouteByRequest(): void {
61-
list($read, $_) = IO\pipe_nd();
61+
list($read, $_) = IO\pipe();
6262
$request = ServerRequestFactory::fromGlobals($read, dict[
6363
'REQUEST_METHOD' => 'GET',
6464
'REQUEST_URI' => '/testing?param=testing'
@@ -76,7 +76,7 @@ final class RouterTest extends HackTest {
7676
}
7777

7878
public function testShouldNotFoundRouteByRequest(): void {
79-
list($read, $_) = IO\pipe_nd();
79+
list($read, $_) = IO\pipe();
8080
$request = ServerRequestFactory::fromGlobals($read, dict[
8181
'REQUEST_METHOD' => 'GET',
8282
'REQUEST_URI' => '/testing'

0 commit comments

Comments
 (0)