mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-17 07:49:54 +03:00
Refactor CustomSlugFilter for simplicity
This commit is contained in:
parent
3a149c9edc
commit
99c1a59dd4
1 changed files with 4 additions and 5 deletions
|
@ -25,10 +25,9 @@ class CustomSlugFilter implements FilterInterface
|
|||
}
|
||||
|
||||
$value = $this->options->isLooselyMode() ? strtolower($value) : $value;
|
||||
if ($this->options->multiSegmentSlugsEnabled) {
|
||||
return trim(str_replace(' ', '-', $value), '/');
|
||||
}
|
||||
|
||||
return str_replace([' ', '/'], '-', $value);
|
||||
return (match ($this->options->multiSegmentSlugsEnabled) {
|
||||
true => trim(str_replace(' ', '-', $value), '/'),
|
||||
false => str_replace([' ', '/'], '-', $value),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue