From 2e429fe2146fbd2e051d7d1aad452c0d6147d91c 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 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Process/Execute.php b/src/Process/Execute.php index 8ce2c69b..b21c51f0 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,22 @@ 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 ProcessHelper|null $helper */ - public function setHelper(?ProcessHelper $helper) + public function setHelper($helper) { if (empty($helper)) { $helper = new ProcessHelper();