From c1327190099f6863873aa7696585a3f6c7e5c606 Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Wed, 3 Feb 2021 21:12:07 +0000 Subject: [PATCH] Make php 7.0 happy with Execute constructor. This can be reverted when #21 is addressed. --- src/Process/Execute.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Process/Execute.php b/src/Process/Execute.php index 8ce2c69b..50687565 100644 --- a/src/Process/Execute.php +++ b/src/Process/Execute.php @@ -44,7 +44,13 @@ class Execute */ public $parallelWaitTime = 200000; - public function __construct(?OutputInterface $output = null, ?ProcessHelper $helper = null) + /** + * TODO: Add nullable type declaration for params when we switch to php 7.1 + * + * @param OutputInterface|null $output + * @param ProcessHelper|null $helper + */ + public function __construct($output = null, $helper = null) { $this->setOutput($output); $this->setHelper($helper); @@ -52,20 +58,23 @@ public function __construct(?OutputInterface $output = null, ?ProcessHelper $hel /** * Output setter. + * TODO: Add nullable type declaration for param when we switch to php 7.1 * * @param OutputInterface|null $output */ - public function setOutput(?OutputInterface $output) + public function setOutput($output) { $this->output = $output ?? new NullOutput(); } /** * Process helper setter. + * TODO: Add nullable type declaration for param when we switch to php 7.1 * * @param OutputInterface|null $output + * @param mixed $helper */ - public function setHelper(?ProcessHelper $helper) + public function setHelper($helper) { if (empty($helper)) { $helper = new ProcessHelper();