mirror of
https://github.com/danog/ipc.git
synced 2024-11-26 20:15:05 +01:00
cs-fix
This commit is contained in:
parent
e119d9d477
commit
cf179aff9d
@ -3,7 +3,6 @@ sudo: false
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 7.0
|
||||
- 7.1
|
||||
- 7.2
|
||||
- 7.3
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use Amp\Loop;
|
||||
use Amp\Ipc\Sync\ChannelledSocket;
|
||||
use Amp\Loop;
|
||||
|
||||
use function Amp\asyncCall;
|
||||
use function Amp\Ipc\connect;
|
||||
@ -19,7 +19,7 @@ Loop::run(static function () {
|
||||
echo "Closed connection".PHP_EOL;
|
||||
};
|
||||
|
||||
$channel = yield connect(sys_get_temp_dir().'/test');
|
||||
$channel = yield connect(\sys_get_temp_dir().'/test');
|
||||
asyncCall($clientHandler, $channel);
|
||||
yield $channel->send('ping');
|
||||
});
|
||||
});
|
||||
|
@ -3,8 +3,8 @@
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use Amp\Ipc\IpcServer;
|
||||
use Amp\Loop;
|
||||
use Amp\Ipc\Sync\ChannelledSocket;
|
||||
use Amp\Loop;
|
||||
|
||||
use function Amp\asyncCall;
|
||||
|
||||
@ -22,8 +22,8 @@ Loop::run(static function () {
|
||||
echo "Closed connection".PHP_EOL."==========".PHP_EOL;
|
||||
};
|
||||
|
||||
$server = new IpcServer(sys_get_temp_dir().'/test');
|
||||
$server = new IpcServer(\sys_get_temp_dir().'/test');
|
||||
while ($socket = yield $server->accept()) {
|
||||
asyncCall($clientHandler, $socket);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -3,8 +3,8 @@
|
||||
namespace Amp\Ipc;
|
||||
|
||||
use Amp\Deferred;
|
||||
use Amp\Loop;
|
||||
use Amp\Ipc\Sync\ChannelledSocket;
|
||||
use Amp\Loop;
|
||||
use Amp\Promise;
|
||||
use Amp\Success;
|
||||
|
||||
|
@ -86,7 +86,7 @@ final class ChannelledSocket implements Channel
|
||||
if ($data instanceof ChannelCloseReq) {
|
||||
yield $channel->send(new ChannelCloseAck);
|
||||
$this->state |= self::GOT_FIN_MASK;
|
||||
} else if ($data instanceof ChannelCloseAck) {
|
||||
} elseif ($data instanceof ChannelCloseAck) {
|
||||
$this->state |= self::GOT_ACK_MASK;
|
||||
}
|
||||
} while ($this->state !== self::GOT_ALL_MASK);
|
||||
|
@ -17,10 +17,10 @@ use function Amp\call;
|
||||
function connect(string $uri): Promise
|
||||
{
|
||||
return call(static function () use ($uri) {
|
||||
if (!file_exists($uri)) {
|
||||
if (!\file_exists($uri)) {
|
||||
throw new \RuntimeException("The endpoint does not exist!");
|
||||
}
|
||||
|
||||
|
||||
$type = \filetype($uri);
|
||||
if ($type !== 'fifo') {
|
||||
if ($type === 'file') {
|
||||
|
@ -22,7 +22,7 @@ return function (Channel $channel) use ($argv) {
|
||||
}
|
||||
|
||||
$ping = yield $socket->receive();
|
||||
|
||||
|
||||
if ($ping !== 'ping') {
|
||||
throw new \RuntimeException("Received $ping instead of ping!");
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class IpcTest extends AsyncTestCase
|
||||
|
||||
public function provideUriFifo(): \Generator
|
||||
{
|
||||
foreach (['', sys_get_temp_dir().'/pony'] as $uri) {
|
||||
foreach (['', \sys_get_temp_dir().'/pony'] as $uri) {
|
||||
if (\strncasecmp(\PHP_OS, "WIN", 3) === 0) {
|
||||
yield [$uri, false];
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user