diff --git a/src/Symfony/Component/Process/ExecutableFinder.php b/src/Symfony/Component/Process/ExecutableFinder.php index cb4345e7bb..aa52cf367d 100644 --- a/src/Symfony/Component/Process/ExecutableFinder.php +++ b/src/Symfony/Component/Process/ExecutableFinder.php @@ -31,10 +31,8 @@ class ExecutableFinder /** * Adds new possible suffix to check for executable. - * - * @param string $suffix */ - public function addSuffix($suffix) + public function addSuffix(string $suffix) { $this->suffixes[] = $suffix; } @@ -48,7 +46,7 @@ class ExecutableFinder * * @return string|null The executable path or default value */ - public function find($name, $default = null, array $extraDirs = []) + public function find(string $name, string $default = null, array $extraDirs = []) { if (ini_get('open_basedir')) { $searchPath = array_merge(explode(PATH_SEPARATOR, ini_get('open_basedir')), $extraDirs); diff --git a/src/Symfony/Component/Process/PhpExecutableFinder.php b/src/Symfony/Component/Process/PhpExecutableFinder.php index 461ea13117..bd0eaf43c0 100644 --- a/src/Symfony/Component/Process/PhpExecutableFinder.php +++ b/src/Symfony/Component/Process/PhpExecutableFinder.php @@ -29,11 +29,9 @@ class PhpExecutableFinder /** * Finds The PHP executable. * - * @param bool $includeArgs Whether or not include command arguments - * * @return string|false The PHP executable path or false if it cannot be found */ - public function find($includeArgs = true) + public function find(bool $includeArgs = true) { if ($php = getenv('PHP_BINARY')) { if (!is_executable($php)) { diff --git a/src/Symfony/Component/Process/Pipes/PipesInterface.php b/src/Symfony/Component/Process/Pipes/PipesInterface.php index 52bbe76b8f..b8e6d26761 100644 --- a/src/Symfony/Component/Process/Pipes/PipesInterface.php +++ b/src/Symfony/Component/Process/Pipes/PipesInterface.php @@ -44,7 +44,7 @@ interface PipesInterface * * @return string[] An array of read data indexed by their fd */ - public function readAndWrite($blocking, $close = false); + public function readAndWrite(bool $blocking, bool $close = false); /** * Returns if the current state has open file handles or pipes. diff --git a/src/Symfony/Component/Process/Pipes/UnixPipes.php b/src/Symfony/Component/Process/Pipes/UnixPipes.php index 875ee6ab8e..ae81b5655d 100644 --- a/src/Symfony/Component/Process/Pipes/UnixPipes.php +++ b/src/Symfony/Component/Process/Pipes/UnixPipes.php @@ -89,7 +89,7 @@ class UnixPipes extends AbstractPipes /** * {@inheritdoc} */ - public function readAndWrite($blocking, $close = false) + public function readAndWrite(bool $blocking, bool $close = false) { $this->unblock(); $w = $this->write(); diff --git a/src/Symfony/Component/Process/Pipes/WindowsPipes.php b/src/Symfony/Component/Process/Pipes/WindowsPipes.php index f44f33b490..b6bfc57103 100644 --- a/src/Symfony/Component/Process/Pipes/WindowsPipes.php +++ b/src/Symfony/Component/Process/Pipes/WindowsPipes.php @@ -126,7 +126,7 @@ class WindowsPipes extends AbstractPipes /** * {@inheritdoc} */ - public function readAndWrite($blocking, $close = false) + public function readAndWrite(bool $blocking, bool $close = false) { $this->unblock(); $w = $this->write(); diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 71a4aa7a71..92fd775f17 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -495,7 +495,7 @@ class Process implements \IteratorAggregate * @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed * @throws RuntimeException In case of failure */ - public function signal($signal) + public function signal(int $signal) { $this->doSignal($signal, true); @@ -897,7 +897,7 @@ class Process implements \IteratorAggregate * * @return int The exit-code of the process */ - public function stop($timeout = 10, $signal = null) + public function stop(float $timeout = 10, int $signal = null) { $timeoutMicro = microtime(true) + $timeout; if ($this->isRunning()) { @@ -1028,13 +1028,11 @@ class Process implements \IteratorAggregate /** * Enables or disables the TTY mode. * - * @param bool $tty True to enabled and false to disable - * * @return self The current Process instance * * @throws RuntimeException In case the TTY mode is not supported */ - public function setTty($tty) + public function setTty(bool $tty) { if ('\\' === \DIRECTORY_SEPARATOR && $tty) { throw new RuntimeException('TTY mode is not supported on Windows platform.'); @@ -1062,13 +1060,11 @@ class Process implements \IteratorAggregate /** * Sets PTY mode. * - * @param bool $bool - * * @return self */ - public function setPty($bool) + public function setPty(bool $bool) { - $this->pty = (bool) $bool; + $this->pty = $bool; return $this; } @@ -1102,11 +1098,9 @@ class Process implements \IteratorAggregate /** * Sets the current working directory. * - * @param string $cwd The new working directory - * * @return self The current Process instance */ - public function setWorkingDirectory($cwd) + public function setWorkingDirectory(string $cwd) { $this->cwd = $cwd; @@ -1185,11 +1179,9 @@ class Process implements \IteratorAggregate /** * Sets whether environment variables will be inherited or not. * - * @param bool $inheritEnv - * * @return self The current Process instance */ - public function inheritEnvironmentVariables($inheritEnv = true) + public function inheritEnvironmentVariables(bool $inheritEnv = true) { if (!$inheritEnv) { throw new InvalidArgumentException('Not inheriting environment variables is not supported.'); @@ -1316,7 +1308,7 @@ class Process implements \IteratorAggregate * * @param bool $blocking Whether to use a blocking read call */ - protected function updateStatus($blocking) + protected function updateStatus(bool $blocking) { if (self::STATUS_STARTED !== $this->status) { return; diff --git a/src/Symfony/Component/Process/ProcessUtils.php b/src/Symfony/Component/Process/ProcessUtils.php index 2f9c4be4de..5b6879ae3a 100644 --- a/src/Symfony/Component/Process/ProcessUtils.php +++ b/src/Symfony/Component/Process/ProcessUtils.php @@ -39,7 +39,7 @@ class ProcessUtils * * @throws InvalidArgumentException In case the input is not valid */ - public static function validateInput($caller, $input) + public static function validateInput(string $caller, $input) { if (null !== $input) { if (\is_resource($input)) {