From 8cbd431dabee93140cdd078f1b637e4818b57118 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Wed, 20 Sep 2017 11:54:19 +0200 Subject: [PATCH] Update Travis config and fix code style --- .travis.yml | 2 +- composer.json | 3 +-- examples/ping-many.php | 4 +--- lib/Internal/ProcessRunner.php | 2 +- lib/Internal/Windows/SocketConnector.php | 18 +++++++++++++----- lib/ProcessInputStream.php | 2 +- lib/ProcessOutputStream.php | 2 +- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 26ff5c4..0bc1b46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ language: php php: - 7.0 - 7.1 + - 7.2 - nightly matrix: @@ -19,7 +20,6 @@ install: script: - phpdbg -qrr vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml - - php vendor/bin/fqn-check lib - PHP_CS_FIXER_IGNORE_ENV=1 php vendor/bin/php-cs-fixer --diff --dry-run -v fix after_script: diff --git a/composer.json b/composer.json index 2bf54f6..61baabd 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,7 @@ "require-dev": { "phpunit/phpunit": "^6", "amphp/phpunit-util": "^1", - "friendsofphp/php-cs-fixer": "^2.3", - "kelunik/fqn-check": "^0.1.3" + "friendsofphp/php-cs-fixer": "^2.3" }, "license": "MIT", "authors": [ diff --git a/examples/ping-many.php b/examples/ping-many.php index 1b61775..475c2f9 100644 --- a/examples/ping-many.php +++ b/examples/ping-many.php @@ -3,11 +3,9 @@ include dirname(__DIR__) . "/vendor/autoload.php"; use Amp\Process\Process; -use Amp\Promise; use function Amp\Promise\all; -function show_process_output(Process $process): \Generator -{ +function show_process_output(Process $process): \Generator { $stream = $process->getStdout(); while (null !== $chunk = yield $stream->read()) { diff --git a/lib/Internal/ProcessRunner.php b/lib/Internal/ProcessRunner.php index ea17e4b..bfbcbb2 100644 --- a/lib/Internal/ProcessRunner.php +++ b/lib/Internal/ProcessRunner.php @@ -39,7 +39,7 @@ interface ProcessRunner { public function kill(ProcessHandle $handle); /** - * Send a signal signal to the child process + * Send a signal signal to the child process. * * @param ProcessHandle $handle The process descriptor. * @param int $signo Signal number to send to process. diff --git a/lib/Internal/Windows/SocketConnector.php b/lib/Internal/Windows/SocketConnector.php index 97a0748..58bc341 100644 --- a/lib/Internal/Windows/SocketConnector.php +++ b/lib/Internal/Windows/SocketConnector.php @@ -187,8 +187,10 @@ final class SocketConnector { if ($packet['signal'] !== SignalCode::HANDSHAKE_ACK || $packet['status'] !== HandshakeStatus::SUCCESS) { $this->failHandleStart( - $handle, "Client rejected handshake with code %d for stream #%d", - $packet['status'], $pendingClient->streamId + $handle, + "Client rejected handshake with code %d for stream #%d", + $packet['status'], + $pendingClient->streamId ); return; } @@ -215,7 +217,9 @@ final class SocketConnector { if (\strlen($data) !== 5) { $this->failHandleStart( - $handle, 'Failed to read PID from wrapper: Received %d of 5 expected bytes', \strlen($data) + $handle, + 'Failed to read PID from wrapper: Received %d of 5 expected bytes', + \strlen($data) ); return; } @@ -224,7 +228,9 @@ final class SocketConnector { if ($packet['signal'] !== SignalCode::CHILD_PID) { $this->failHandleStart( - $handle, "Failed to read PID from wrapper: Unexpected signal code %d", $packet['signal'] + $handle, + "Failed to read PID from wrapper: Unexpected signal code %d", + $packet['signal'] ); return; } @@ -266,7 +272,9 @@ final class SocketConnector { if ($packet['signal'] !== SignalCode::EXIT_CODE) { $this->failHandleStart( - $handle, "Failed to read exit code from wrapper: Unexpected signal code %d", $packet['signal'] + $handle, + "Failed to read exit code from wrapper: Unexpected signal code %d", + $packet['signal'] ); return; } diff --git a/lib/ProcessInputStream.php b/lib/ProcessInputStream.php index 92992b1..5fc52ee 100644 --- a/lib/ProcessInputStream.php +++ b/lib/ProcessInputStream.php @@ -102,4 +102,4 @@ class ProcessInputStream implements InputStream { $this->resourceStream->close(); } } -} \ No newline at end of file +} diff --git a/lib/ProcessOutputStream.php b/lib/ProcessOutputStream.php index 29d8f11..a9b1af4 100644 --- a/lib/ProcessOutputStream.php +++ b/lib/ProcessOutputStream.php @@ -101,4 +101,4 @@ class ProcessOutputStream implements OutputStream { $this->resourceStream->close(); } } -} \ No newline at end of file +}