diff --git a/.travis.yml b/.travis.yml index 71b9734..674bf59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ sudo: false language: php php: - - 7.0 - 7.1 - 7.2 - 7.3 diff --git a/examples/client.php b/examples/client.php index 4627563..9c93ac8 100644 --- a/examples/client.php +++ b/examples/client.php @@ -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'); -}); \ No newline at end of file +}); diff --git a/examples/server.php b/examples/server.php index 56f5638..b2fec73 100644 --- a/examples/server.php +++ b/examples/server.php @@ -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); } -}); \ No newline at end of file +}); diff --git a/lib/IpcServer.php b/lib/IpcServer.php index c9bb439..f964623 100644 --- a/lib/IpcServer.php +++ b/lib/IpcServer.php @@ -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; diff --git a/lib/Sync/ChannelledSocket.php b/lib/Sync/ChannelledSocket.php index 2926ef5..4aaff00 100644 --- a/lib/Sync/ChannelledSocket.php +++ b/lib/Sync/ChannelledSocket.php @@ -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); diff --git a/lib/functions.php b/lib/functions.php index c6c1498..8b899ec 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -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') { diff --git a/test/Fixtures/server.php b/test/Fixtures/server.php index ff60bff..c99fa7d 100644 --- a/test/Fixtures/server.php +++ b/test/Fixtures/server.php @@ -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!"); } diff --git a/test/IpcTest.php b/test/IpcTest.php index 2e1e96d..3cc9c63 100644 --- a/test/IpcTest.php +++ b/test/IpcTest.php @@ -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 {