Skip to content

Commit 8ee8631

Browse files
committed
Use match statement for clarity
1 parent 6f5c53d commit 8ee8631

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Message.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,10 @@ public function flag(mixed $flag, string $operation, bool $expunge = false): voi
432432
$this->folder->expunge();
433433
}
434434

435-
$this->flags = $operation === '+'
436-
? array_unique(array_merge($this->flags, [$flag]))
437-
: array_diff($this->flags, [$flag]);
435+
$this->flags = match($operation) {
436+
'+' => array_unique(array_merge($this->flags, [$flag])),
437+
'-' => array_diff($this->flags, [$flag]),
438+
};
438439
}
439440

440441
/**

0 commit comments

Comments
 (0)