mirror of
https://github.com/danog/process.git
synced 2024-11-30 04:39:04 +01:00
Update Travis config and fix code style
This commit is contained in:
parent
96491ebfe1
commit
8cbd431dab
@ -5,6 +5,7 @@ language: php
|
|||||||
php:
|
php:
|
||||||
- 7.0
|
- 7.0
|
||||||
- 7.1
|
- 7.1
|
||||||
|
- 7.2
|
||||||
- nightly
|
- nightly
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
@ -19,7 +20,6 @@ install:
|
|||||||
|
|
||||||
script:
|
script:
|
||||||
- phpdbg -qrr vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
|
- 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
|
- PHP_CS_FIXER_IGNORE_ENV=1 php vendor/bin/php-cs-fixer --diff --dry-run -v fix
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^6",
|
"phpunit/phpunit": "^6",
|
||||||
"amphp/phpunit-util": "^1",
|
"amphp/phpunit-util": "^1",
|
||||||
"friendsofphp/php-cs-fixer": "^2.3",
|
"friendsofphp/php-cs-fixer": "^2.3"
|
||||||
"kelunik/fqn-check": "^0.1.3"
|
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
|
@ -3,11 +3,9 @@
|
|||||||
include dirname(__DIR__) . "/vendor/autoload.php";
|
include dirname(__DIR__) . "/vendor/autoload.php";
|
||||||
|
|
||||||
use Amp\Process\Process;
|
use Amp\Process\Process;
|
||||||
use Amp\Promise;
|
|
||||||
use function Amp\Promise\all;
|
use function Amp\Promise\all;
|
||||||
|
|
||||||
function show_process_output(Process $process): \Generator
|
function show_process_output(Process $process): \Generator {
|
||||||
{
|
|
||||||
$stream = $process->getStdout();
|
$stream = $process->getStdout();
|
||||||
|
|
||||||
while (null !== $chunk = yield $stream->read()) {
|
while (null !== $chunk = yield $stream->read()) {
|
||||||
|
@ -39,7 +39,7 @@ interface ProcessRunner {
|
|||||||
public function kill(ProcessHandle $handle);
|
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 ProcessHandle $handle The process descriptor.
|
||||||
* @param int $signo Signal number to send to process.
|
* @param int $signo Signal number to send to process.
|
||||||
|
@ -187,8 +187,10 @@ final class SocketConnector {
|
|||||||
|
|
||||||
if ($packet['signal'] !== SignalCode::HANDSHAKE_ACK || $packet['status'] !== HandshakeStatus::SUCCESS) {
|
if ($packet['signal'] !== SignalCode::HANDSHAKE_ACK || $packet['status'] !== HandshakeStatus::SUCCESS) {
|
||||||
$this->failHandleStart(
|
$this->failHandleStart(
|
||||||
$handle, "Client rejected handshake with code %d for stream #%d",
|
$handle,
|
||||||
$packet['status'], $pendingClient->streamId
|
"Client rejected handshake with code %d for stream #%d",
|
||||||
|
$packet['status'],
|
||||||
|
$pendingClient->streamId
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -215,7 +217,9 @@ final class SocketConnector {
|
|||||||
|
|
||||||
if (\strlen($data) !== 5) {
|
if (\strlen($data) !== 5) {
|
||||||
$this->failHandleStart(
|
$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;
|
return;
|
||||||
}
|
}
|
||||||
@ -224,7 +228,9 @@ final class SocketConnector {
|
|||||||
|
|
||||||
if ($packet['signal'] !== SignalCode::CHILD_PID) {
|
if ($packet['signal'] !== SignalCode::CHILD_PID) {
|
||||||
$this->failHandleStart(
|
$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;
|
return;
|
||||||
}
|
}
|
||||||
@ -266,7 +272,9 @@ final class SocketConnector {
|
|||||||
|
|
||||||
if ($packet['signal'] !== SignalCode::EXIT_CODE) {
|
if ($packet['signal'] !== SignalCode::EXIT_CODE) {
|
||||||
$this->failHandleStart(
|
$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;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -102,4 +102,4 @@ class ProcessInputStream implements InputStream {
|
|||||||
$this->resourceStream->close();
|
$this->resourceStream->close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,4 +101,4 @@ class ProcessOutputStream implements OutputStream {
|
|||||||
$this->resourceStream->close();
|
$this->resourceStream->close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user