Skip to content

Commit 1931081

Browse files
derrabusnicolas-grekas
authored andcommitted
Fix inconsistent return points.
1 parent 82ef18a commit 1931081

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Process.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,25 +1304,21 @@ private function getDescriptors(): array
13041304
protected function buildCallback(callable $callback = null)
13051305
{
13061306
if ($this->outputDisabled) {
1307-
return function ($type, $data) use ($callback) {
1308-
if (null !== $callback) {
1309-
return $callback($type, $data);
1310-
}
1307+
return function ($type, $data) use ($callback): bool {
1308+
return null !== $callback && $callback($type, $data);
13111309
};
13121310
}
13131311

13141312
$out = self::OUT;
13151313

1316-
return function ($type, $data) use ($callback, $out) {
1314+
return function ($type, $data) use ($callback, $out): bool {
13171315
if ($out == $type) {
13181316
$this->addOutput($data);
13191317
} else {
13201318
$this->addErrorOutput($data);
13211319
}
13221320

1323-
if (null !== $callback) {
1324-
return $callback($type, $data);
1325-
}
1321+
return null !== $callback && $callback($type, $data);
13261322
};
13271323
}
13281324

0 commit comments

Comments
 (0)