Skip to content

Commit 21b4d0c

Browse files
tigitznicolas-grekas
authored andcommitted
Leverage arrow function syntax for closure
1 parent ba6e553 commit 21b4d0c

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Process.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,9 +1253,7 @@ private function getDescriptors(): array
12531253
protected function buildCallback(callable $callback = null): \Closure
12541254
{
12551255
if ($this->outputDisabled) {
1256-
return function ($type, $data) use ($callback): bool {
1257-
return null !== $callback && $callback($type, $data);
1258-
};
1256+
return fn ($type, $data): bool => null !== $callback && $callback($type, $data);
12591257
}
12601258

12611259
$out = self::OUT;

Tests/ProcessTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function testWaitUntilCanReturnFalse()
155155
{
156156
$p = $this->getProcess('echo foo');
157157
$p->start();
158-
$this->assertFalse($p->waitUntil(function () { return false; }));
158+
$this->assertFalse($p->waitUntil(fn () => false));
159159
}
160160

161161
public function testAllOutputIsActuallyReadOnTermination()

0 commit comments

Comments
 (0)