Skip to content

Commit 5179b12

Browse files
derrabusnicolas-grekas
authored andcommitted
Fix inconsistent return points.
1 parent 60838d6 commit 5179b12

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Pipes/AbstractPipes.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ protected function unblock()
8888
/**
8989
* Writes input to stdin.
9090
*
91+
* @return array|null
92+
*
9193
* @throws InvalidArgumentException When an input iterator yields a non supported value
9294
*/
9395
protected function write()
9496
{
9597
if (!isset($this->pipes[0])) {
96-
return;
98+
return null;
9799
}
98100
$input = $this->input;
99101

@@ -122,7 +124,7 @@ protected function write()
122124

123125
// let's have a look if something changed in streams
124126
if (false === @stream_select($r, $w, $e, 0, 0)) {
125-
return;
127+
return null;
126128
}
127129

128130
foreach ($w as $stdin) {
@@ -166,6 +168,8 @@ protected function write()
166168
} elseif (!$w) {
167169
return [$this->pipes[0]];
168170
}
171+
172+
return null;
169173
}
170174

171175
/**

Tests/ProcessTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,8 @@ public function testInputStreamWithCallable()
12311231

12321232
return $stream;
12331233
}
1234+
1235+
return null;
12341236
};
12351237

12361238
$input = new InputStream();

0 commit comments

Comments
 (0)