Skip to content

Commit

Permalink
Simplify code with match block
Browse files Browse the repository at this point in the history
Co-authored-by: Nico Hoffmann  ෴. <[email protected]>
  • Loading branch information
bastianallgeier and distantnative authored Nov 27, 2024
1 parent c3e546f commit d40071a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Content/Lock.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ public static function legacy(ModelWithContent $model): static|null
*/
public static function legacyFile(ModelWithContent $model): string
{
$root = $model::CLASS_ALIAS === 'file' ? dirname($model->root()) : $model->root();
$root = match ($model::CLASS_ALIAS) {
'file' => dirname($model->root()),
default => $model->root()
};
return $root . '/.lock';
}

Expand Down

0 comments on commit d40071a

Please sign in to comment.