Skip to content

Commit 4ee8339

Browse files
committed
QA: Use short closires
1 parent ee6125b commit 4ee8339

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/php/web/filters/Origins.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ public function ports($ports): self {
4141
$this->ports= [];
4242
foreach (is_array($ports) ? $ports : [$ports] as $arg) {
4343
if (null === $arg) {
44-
$this->ports[]= function($port) { return null === $port; };
44+
$this->ports[]= fn($port) => null === $port;
4545
} else if ('*' === $arg) {
46-
$this->ports[]= function($port) { return true; };
46+
$this->ports[]= fn($port) => true;
4747
} else if (is_numeric($arg)) {
4848
$cmp= (int)$arg;
49-
$this->ports[]= function($port) use($cmp) { return $cmp === $port; };
49+
$this->ports[]= fn($port) => $cmp === $port;
5050
} else if (is_string($arg) && 2 === sscanf($arg, '%d..%d', $lo, $hi)) {
51-
$this->ports[]= function($port) use($lo, $hi) { return $port >= $lo && $port <= $hi; };
51+
$this->ports[]= fn($port) => $port >= $lo && $port <= $hi;
5252
} else {
5353
throw new IllegalArgumentException('Unexpected '.Objects::stringOf($arg));
5454
}

0 commit comments

Comments
 (0)